Skip to content
Advertisement

struct ip_mreq disappears when compiling with -std=c99

On some of our linux boxes compiling with gcc -std=c99 makes struct ip_mreq disappear (included from netinet/in.h)

Is there some other interface we are supposed to use ?

Advertisement

Answer

Try –std=gnu99.

The default for GCC is ‘–std=gnu89’ which means C89 with GNU extensions. By selecting ‘–std=c99’ you are enabling C99, but disabling the GNU extensions. ‘–std=gnu99’ will select both C99 and GNU extensions support, giving you the best of both worlds.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement