John (Eljay) Love-Jensen wrote:
Hi Yang Zhang,
Hi, I'd like to use -Wold-style-cast for my own code, but when I use
such macros as <arpa/inet.h>'s INADDR_ANY (which is #defined as
`((in_addr_t) 0x00000000)`), I get warnings for that. Any way around
this? Thanks!
I'd use this technique:
#undef INADDR_ANY
in_addr_t const INADDR_ANY = in_addr_t(0x00000000);
Could put that in your own my_own_inet.h, and have your header #include
<arpa/inet.h>, and replace the preprocessor #define constants with C/C++
constants.
HTH,
--Eljay
But is there any workaround for this problem in general, where the
source of the problem is a macro defined in a system header? I'm seeing
the same problem with FD_SET, FD_ISSET, etc.
--
Yang Zhang
http://www.mit.edu/~y_z/