config/ag_macros.m4 has a couple of bugs
Brought to you by:
bkorb
See attached patch for my proposed fixed.
First issue is a C99 compliance issue. No return type is specified for the function foo. Explicity return types are required by C99.
Second issue is a missing comma from the invocation of AC_RUN_IFELSE( missing a comma between it's first and second params. This result in a string being inserted into the C code which always causes the test to fail even when the strcspn function works fine.
Bug opened as part of this effort:
https://fedoraproject.org/wiki/Toolchain/PortingToModernC
Not defaulting to an "int" return type is a severe divergence from historical "C". Is that under the control of a cranked up warning level? That breaks the world. Anyway, I've applied your patch to my sources. If I can ever get "autoreconf" to work again, then I'll release it. :(
It's not that bad, implicit ints are somewhat rare and easy to fix. The implicit function declarations are more work in my experience, but they also provide greater benefit to programmers (although I've seen bugs due to implicit ints as well).
:) It's that bad for folks who like warnings as errors. A reasonable thing to do for project code. Probably, that shouldn't be done for configure probes. So, my project will be 4 bytes larger now. :-D