Bug#1061655: wine: FTBFS with error: unknown conversion type character ‘I’ in format [-Werror=format=]
I got more input on #debian-arm:
<iam_tj[m]1> <pere> "iam_tj: i386 seem to work. :/" <- That's because
the compiler options for the 32-bit architectures include `-Wformat`
(equivalent to `-Wformat=1`) but the 64-bit architectures have
`-Wno-format` (equivalent to `-Wformat=0`)
<iam_tj[m]1> pere: see with:
getbuildlog wine last
for log in wine_9.0~repack-2_*.log; do echo "Searching $log"; grep -n -- '-c -o programs/winedbg.*/info\.o' $log | tee $log.match; done
grep -El 'Wno-format( |$)' wine_9.0~repack-2_*.log.match
grep -El 'Wformat( |$)' wine_9.0~repack-2_*.log.match
that gives:
$ grep -El 'Wno-format( |$)' wine_9.0~repack-2_*.log.match
wine_9.0~repack-2_amd64.log.match
wine_9.0~repack-2_arm64.log.match
$ grep -El 'Wformat( |$)' wine_9.0~repack-2_*.log.match
wine_9.0~repack-2_armel.log.match
wine_9.0~repack-2_armhf.log.match
wine_9.0~repack-2_i386.log.match
<pere> is this explaining why i386 build but armel do not? Both seem
to have -Wformat.
<iam_tj[m]1> The i386 build uses i686-w64-mingw32-gcc but the
armhf/armel builds use gcc
<iam_tj[m]1> So there's two differences combine to obscure things; 1)
64-bits don't check the format string and 2) different compilers
between x86 and ARM arches for 32-bit
<iam_tj[m]1> compiler options are quite different too:
$ wdiff -3 wine_9.0~repack-2_{i386,armhf}.log.match
======================================================================
[-8455:i686-w64-mingw32-gcc-]{+8702:gcc+}
======================================================================
[-programs/winedbg/i386-windows/info.o-] {+programs/winedbg/info.o+}
======================================================================
[--D__WINE_PE_BUILD-]
======================================================================
{+-pipe -fcf-protection=none -fvisibility=hidden -fno-stack-protector+}
======================================================================
[--Wabsolute-value -Wenum-conversion -fno-omit-frame-pointer -mpreferred-stack-boundary=2-]
======================================================================
{+-fPIC -fasynchronous-unwind-tables -D_WIN32 -fno-builtin -fshort-wchar+}
======================================================================
{+-fstack-clash-protection+}
======================================================================
{+-Wno-unused-function -mthumb -mfloat-abi=hard+}
======================================================================
<iam_tj[m]1> pere: the format specifier itself is definitely incorrect
as I said earlier - additionally it looks like the width value
`ADDRWIDTH` is incorrect since it will be 64 on 32-bit systems, but
the value should be the width in characters, NOT bits! My guess is
that ought to be ` ADDRWIDTH / 8`; a minimal test-case to show the
format specifier error:
$ cat bad-format-specifier.c; gcc -Werror=format -Wformat=1 -o
bad-format-specifier bad-format-specifier.c
#include <stdio.h>
int main(int argc, char **argv, char **env) {
int ADDRWIDTH = 64;
long long base = 0x11223344;
printf ( "0x%0I*lld is not a valid module address\n", ADDRWIDTH, base);
printf ( "0x%0*Illd is not a valid module address\n", ADDRWIDTH, base);
return 0;
}
bad-format-specifier.c: In function ‘main’:
bad-format-specifier.c:7:24: error: unknown conversion type character ‘I’ in format [-Werror=format=]
7 | printf ( "0x%0*Illd is not a valid module address\n", ADDRWIDTH, base);
| ^
bad-format-specifier.c:7:18: error: too many arguments for format [-Werror=format-extra-args]
7 | printf ( "0x%0*Illd is not a valid module address\n", ADDRWIDTH, base);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
This is on amd64, which also shows that it would have failed on the
64-bit architectures if they used `-Wformat -Werror=format`
<iam_tj[m]1> In the code above the 1st printf corrects the format
specifier and the 2nd copies the one in wine (indirectly from
debian/patches/arm/format-strings.patch )
--
Happy hacking
Petter Reinholdtsen
Reply to: