std=c89 breaks external libev build
Closed this issue · 2 comments
I ran into a problem detecting the system libev packaging libverto 0.3.0 for Debian.
The debian ev.h has code like:
#if __STDC_VERSION__ >= 199901L || __GNUC__ >= 3
# define EV_INLINE static inline
#else
# define EV_INLINE static
#endif
EV_INLINE struct ev_loop *
ev_default_loop_uc_ (void) EV_NOEXCEPT
And when building with -std=c89
I get errors like:
/usr/include/ev.h:564:11: error: expected ‘;’ before ‘struct’
EV_INLINE struct ev_loop *
^~~~~~
I don't quite understand what's going wrong, but honestly I shouldn't have to. It's 2019; c99 is 20 years old.
It's unsurprising that even if verto tests c89 complience, not all dependencies will do so, and the problem will become worse not better over time.
It seems fine to run a CI build forcing c89 to make sure it works if you care about that, but I think for people building libev to actually use the software, requiring all dependencies build in c89 mode is overly fragile.
It's 2019; c99 is 20 years old. It's unsurprising that even if verto tests c89 complience, not all dependencies will do so, and the problem will become worse not better over time.
I agree, but tell that to krb5. The only reason we care about c89 at all is because krb5 bundles our (libverto's) libev interface (in src/util/verto). krb5 needs to be in c89 (for Windows).
I can empathize with libev posing a problem in this regard. I've definitely made mistakes in this regard that I've had to correct, which is why the CI looks the way it does. I will point out that debian is tested in CI.
Now all that said, I've got a commit in master that fixes the c89 problem. Let me cut a release with that and it should make things easier.
Should be fixed in c63359e