stdio: fix use of PRIdMAX on modern mingw
Commit
cf88e56ab broke the use of PRIdMAX and friends on modern
mingw64 installations. Basically, when requesting
_USE_MINGW_ANSI_STDIO, not only does mingw turn on support for %lld,
it also rewrites <inttypes.h> to provide PRIdMAX as "lld" instead of
"I64d" (but only when <stdio.h> is also included). But if a user is
NOT using the gnulib printf module, gnulib's <stdio.h> was still
giving printf() the system printf attribute, which causes the
compiler to then complain about an unknown %lld specifier, even though
we know we don't need to use the non-standard %I64d. So this patch
adds a configure-time probe that should work with older gcc (which
does not differentiate between printf flavors) and older mingw (where
_USE_MINGW_ANSI_STDIO has no impact on behavior), while fixing the
mismatch in flavors on modern systems.
* m4/stdio_h.m4 (gl_STDIO_H): Probe for printf flavor via inttypes.
* lib/stdio.in.h (_GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM): Use result
to work with modern mingw.
Signed-off-by: Eric Blake <eblake@redhat.com>