Closed DankRank closed 7 years ago
I remembered that git blame is a thing: 34634576. It looks like this was supposed to be only applied on windows.
What I noticed while messing around with config.h.in
, is that there's no warning if you first include config.h
and then stdio.h
, but fwrite_unlocked
(the function, not the macro) doesn't get declared. It's only when you include them backwards it generates the warning. But how does this happen if config.h
is the first include in every file? The answer: someone forgot include guards in config.h
:V
When compiling any file that includes both
stdio.h
andconfig.h
, GCC gives me this warning:Apparently
bits/stdio.h
contains inlined implementation offwrite_unlocked
as a macro, so it conflicts with the definition inconfig.h
. Oddly enough this only happens tofwrite_unlocked
, even though e.g.fread_unlocked
is also defined as a macro in both places.I'm not sure why those
config.h
defines are needed in the first place, which is why I'm posting this here instead of pushing a seemingly simple fix (#undef
)My GCC is
4.8.4
targetingx86_64-linux-gnu
. My glibc is2.19
. OS: Linux subsystem on Windows 10