On Sun, Jul 19, 2015 at 10:51:15AM +0200 I heard the voice of
Richard Levitte, and lo! it spake thus:
>
> So you see, defining __USE_POSIX in util.c does exactly nothing.
Actually, it probably "works" since features.h has already run at that
point, so it's hacking behind its back.
> So, defining _POSIX_C_SOURCE is quite correct. However, because
> features.h is include *much* earlier, you have to define it much
> higher up. See attached patch.
Higher than that would be better, really. A lot of the warns are
related to similar things. What's changed is that I've adjusted the
config process to add "-std=c99" to the compiler flags if the compiler
supports it[0]. That causes glibc's headers (mostly via features.h)
to be a lot stricter about what functions it exports; particularly
POSIX stuff that isn't ANSI stops showing up.
So the Real Solution(tm) is to notice we're using a glibc that does
that, and add central configuration to request those feature sets.
Changes added to r397 of trunk, so another pull should get you solid.
It builds cleanly for me on BSD with gcc 4.8 and clang 3.6, and builds
completely and _almost_ cleanly with gcc 5.1 on Fedora 22. The only
warnings come from the flex output, and there's only so much we can do
with that (well, we _could_ do a tad more maybe, but it gets
increasingly messy).
I did setup a Fed22 VM to work on this, and in fact the default shell
config DOES stick a /usr/lib64/ccache/ right up front in the path.
What the heck, guys? It builds OK for me with that as well, though I
presumably have whatever extra packages are needed for that toolchain.
I used /usr/bin/cc by default in testing, since I copy in my OWN shell
rc files, that don't have a stupid path ;)
[0] If it doesn't, we still go ahead without it, but with a warning
that things might go haywire. It's probable most compilers people
will be using nowadays do C99, and those that don't probably
still implement enough of it as extensions that we're OK.
--
Matthew Fuller (MF4839) | [email protected]
Systems/Network Administrator | http://www.over-yonder.net/~fullermd/
On the Internet, nobody can hear you scream.