Struct ip_mreq disappears when compiled with -std = c99

In some of our linux packages, compiling with gcc -std = c99 makes struct ip_mreq disappear (included with netinet / in.h)

Is there any other interface we should use?

+3
source share
3 answers

Try --std = gnu99.

The default for GCC is '--std = gnu89', which means C89 with GNU extensions. Choosing "-std = c99" will enable C99, but disable GNU extensions. '--std = gnu99' will choose support for C99 and GNU, giving you the best of both worlds.

+4
source

, pre-c99. -std=c99, () :

#define __EXTENSIONS__

, ,

#define _XOPEN_SOURCE

, .

0

I have the same problem. Everything compiles using gcc when I do not provide "-std = c99", but when the flag is on, the compiler does not say that the field with the type "struct ip_mreq" has an incomplete type. "

This is a problem as I am dependent on some features of the C99.

0
source

Source: https://habr.com/ru/post/1708665/


All Articles