Subject: | build failure (with -Werror=format-security) |
When trying to update Future-AsyncAwait to 0.31 in Debian, I noticed a compiler error (actually a warning that is treated as an error by Debian's default gcc flags):
perl Build
Building Future-AsyncAwait
x86_64-linux-gnu-gcc -I/usr/lib/x86_64-linux-gnu/perl/5.28/CORE -DVERSION="0.31" -DXS_VERSION="0.31" -fPIC -std=c89 -Ihax -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fdebug-prefix-map=/build/libfuture-asyncawait-perl-0.31=. -fstack-protector-strong -Wformat -Werror=format-security -g -O2 -fdebug-prefix-map=/build/libfuture-asyncawait-perl-0.31=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -o lib/Future/AsyncAwait.o lib/Future/AsyncAwait.c
In file included from lib/Future/AsyncAwait.xs:21:
hax/parse_subsignature.c.inc: In function 'S_yyerror':
hax/parse_subsignature.c.inc:34:22: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'line_t' {aka 'unsigned int'} [-Wformat=]
sv_catpvf(message, "%s at %s line %" IVdf,
^~~~~~~~~~~~~~~~~
hax/parse_subsignature.c.inc:44:3: error: format not a string literal and no format arguments [-Werror=format-security]
warn(SvPVX(message));
^~~~
cc1: some warnings being treated as errors
error building lib/Future/AsyncAwait.o from 'lib/Future/AsyncAwait.c' at /usr/share/perl/5.28/ExtUtils/CBuilder/Base.pm line 185.