ywkaras commented on code in PR #9875:
URL: https://github.com/apache/trafficserver/pull/9875#discussion_r1244447001


##########
include/wccp/Wccp.h:
##########
@@ -121,7 +124,7 @@ class ServiceGroup : public ServiceConstants
   static uint8_t const RESERVED = 50;
 
   /// Number of ports in component (defined by protocol).
-  static size_t const N_PORTS = 8;
+  static constexpr size_t const N_PORTS = 8;

Review Comment:
   So, why does the compiler complain about j and k here but not i?
   ```
   wkaras /tmp/xx
   $ cat x.cc
   struct S
   {
     static const int i{666};
     static const int j;
     static int k;
   };
   
   volatile int i;
   
   int main()
   {
     i = S::i;
     i = S::j;
     i = S::k;
   
     return 0;
   }
   wkaras /tmp/xx
   $ gcc -O0 -Wall -Wextra -pedantic -std=c++17 x.cc
   /usr/bin/ld: /tmp/ccGXX6cg.o: in function `main':
   x.cc:(.text+0x14): undefined reference to `S::j'
   /usr/bin/ld: x.cc:(.text+0x20): undefined reference to `S::k'
   collect2: error: ld returned 1 exit status
   wkaras /tmp/xx
   $ 
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to