This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/54361] New: Compiling for c++11 gives a warning on scanf() with %as format specifier


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]