Message252968
the ac_cv_have_long_long_format test has a nice compile-time fallback for gcc based compilers:
CFLAGS="$CFLAGS -Werror -Wformat"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
#include <stddef.h>
]], [[
char *buffer;
sprintf(buffer, "%lld", (long long)123);
sprintf(buffer, "%lld", (long long)-123);
sprintf(buffer, "%llu", (unsigned long long)123);
]])],
ac_cv_have_long_long_format=yes
)
unfortunately, this turns on the global -Werror flag in order to check things. that means if the code triggers unrelated warnings, the test still fails ;(. this comes up w/bionic which complains about unsafe use of the sprintf function, and can come up in general in this code because buffer is not initialized :).
the good news is that gcc-4.2 has supported a directed -Werror=format option.
https://gcc.gnu.org/onlinedocs/gcc-4.2.4/gcc/Warning-Options.html
so instead of using -Werror -Wformat, you could use -Werror=format. the downside is that the fallback no longer works with <=gcc-4.1, but maybe that's ok considering gcc-4.2 was released May 2007 (almost 9 years ago) ?
note: this also applies to various other tests in the configure file.
NB: landing a fix in py3.5+ (and ignoring 3.[0-4]) is fine, but please also to fix py2.7 :) |
|
Date |
User |
Action |
Args |
2015-10-13 22:50:58 | vapier | set | recipients:
+ vapier |
2015-10-13 22:50:58 | vapier | set | messageid: <1444776658.15.0.414406307364.issue25397@psf.upfronthosting.co.za> |
2015-10-13 22:50:58 | vapier | link | issue25397 messages |
2015-10-13 22:50:57 | vapier | create | |
|