-Wno-format ignored in Ubuntu 14.04 release
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-4.8 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
lsb_release -rd
Description: Ubuntu 14.04.1 LTS
Release: 14.04
gcc --version
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
...
Trying to run a recent glibc testsuite (from glibc trunk) results in testsuite errors because the compiler is overriding the -Wno-format option on the command line. Running the compiler with -v shows that it is appending an additional -Wformat after the user option and that there is no obvious way to override this behaviour. This is a bug.
#include <stdio.h>
int f()
{
int n;
return scanf ("%llllld", &n);
}
The above testcase should compile when compiled with -Wall -Werror -Wno-format, but instead generates errors for the unrecognized format specifier (note that this is a deliberate part of the test).
gcc -v -Wall -Werror -Wno-format /tmp/test.c -c -o /tmp/test.o
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
COLLECT_
/usr/lib/
GNU C (Ubuntu 4.8.2-19ubuntu1) version 4.8.2 (x86_64-linux-gnu)
compiled by GNU C version 4.8.2, GMP version 5.1.3, MPFR version 3.1.2-p3, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-
ignoring nonexistent directory "/usr/local/
ignoring nonexistent directory "/usr/lib/
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/
/usr/local/include
/usr/lib/
/usr/include/
/usr/include
End of search list.
GNU C (Ubuntu 4.8.2-19ubuntu1) version 4.8.2 (x86_64-linux-gnu)
compiled by GNU C version 4.8.2, GMP version 5.1.3, MPFR version 3.1.2-p3, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-
Compiler executable checksum: dc75e0628c9356a
/tmp/test.c: In function ‘f’:
/tmp/test.c:6:3: error: unknown conversion type character ‘l’ in format [-Werror=format=]
return scanf ("%llllld", &n);
^
/tmp/test.c:6:3: error: too many arguments for format [-Werror=
cc1: all warnings being treated as errors
Status changed to 'Confirmed' because the bug affects multiple users.