This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54361] New: Compiling for c++11 gives a warning on scanf() with %as format specifier
- From: "strikosn at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 23 Aug 2012 23:34:05 +0000
- Subject: [Bug c++/54361] New: Compiling for c++11 gives a warning on scanf() with %as format specifier
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54361
Bug #: 54361
Summary: Compiling for c++11 gives a warning on scanf() with
%as format specifier
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: strikosn@gmail.com
Target: x86_64-unknown-linux-gnu
Configured with: /home/utils/src/gcc-4.7.0/configure
--prefix=/home/utils/gcc-4.7.0 --enable-languages=c,c++,objc,fortran
--with-gmp=/home/utils/gmp-5.0.2-static
--with-mpfr=/home/utils/mpfr-3.1.0-static --with-mpc=/home/utils/mpc-0.9-static
--with-as=/home/utils/binutils-2.21.1/bin/as
--with-ld=/home/utils/binutils-2.21.1/bin/ld
Thread model: posix
gcc version 4.7.0 (GCC)
Source code attached as c.cpp
$ g++ -std=c++11 -Wall -Werror c.cpp
c.cpp: In function 'int main()':
c.cpp:10:26: error: format '%a' expects argument of type 'float*', but argument
2 has type 'char**' [-Werror=format]
c.cpp:7:7: error: unused variable 'a' [-Werror=unused-variable]
cc1plus: all warnings being treated as errors