ISO C issues with enum int

Marc Lehmann schmorp at
Thu Feb 28 01:33:05 CET 2013

On Wed, Feb 27, 2013 at 04:41:10PM -0600, Juan Pablo L <jpablolorenzetti at> wrote:
> i can not turned off the pedantic flag and for the above reason. any
> suggestions ?

You could get rid of the -Werror instead and it will work (with luck).

By using those flags you tell gcc that the program you compile is strict
ISO C, but neither your code nor libev can be strict ISO C, as it requires
numerous extensions (such as POSIX, file descriptors, OS-specific
extensions etc.).

So while changing some things in libev might make it compile with those flags
with some gcc versions, this is just because the implementatioon is imperfect
and doesn't aim at catching those non-strict-ISO-C uses.

Think about it: there is no way for you to use the features of libev in
a strict ISO-C program, as there is no way to get e.g. a file descriptor
for ev_io or a stat structure for ev_stat. There is no function to poll
for I/O events in ISO C. Libev can't even call your callback in strict ISO

So, while I will change the enum expressions to be of type in in CVS to
accomodate this, you will likely run into continued problems if you lie
about the programming language you are writing _your_ program in, telling
GCC it's strict ISO-C, when it clearly isn't.

You have to get rid of these flags - your request is quite the same as asking
"I try to compile libev with a fortran compielr, but get syntax errors. Using
a C compiler is not an option".

But that isn't true. It is always an option. The only one, in fact.

                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_    
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at
      -=====/_/_//_/\_,_/ /_/\_\

More information about the libev mailing list