#3499: gcc 4.7 warnings
-------------------------------------+--------------------
        Reporter:  pabs              |       Type:  bug
          Status:  new               |   Priority:  normal
       Milestone:  unspecified       |  Component:  other
         Version:  3.1 beta10        |   Keywords:
      Blocked By:                    |   Blocking:
Operating System:  All/Non-Specific  |
-------------------------------------+--------------------
 I get the following warnings with gcc 4.7 and beta10:

 g++ -DHAVE_CONFIG_H -I. -I..  -DYY_NO_INPUT -D_GNU_SOURCE=1 -D_REENTRANT
 -I/usr/include/SDL    -I/usr/include/libpng12        -D__STDC_FORMA
 T_MACROS -D__STDC_LIMIT_MACROS -DNDEBUG
 -DWZ_DATADIR="\"/usr/share/games/warzone2100\""
 -DLOCALEDIR="\"/usr/share/locale\"" -I.. -I/usr/incl
 ude/GL    -pthread -I/usr/include/freetype2 -I/usr/include/fribidi
 -D_FORTIFY_SOURCE=2 -g -Wno-enum-compare -Wall -Wextra -Wno-unused-para
 meter -Wno-sign-compare -Wcast-align -Wwrite-strings -Wpointer-arith -Wno-
 format-security -DQT_SHARED -I/usr/include/qt4 -I/usr/include/qt4/
 QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtScript   -g -O2
 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=
 format-security -fstack-protector -c -o function.o function.cpp
 fpath.cpp: In function 'void fpathTest(int, int, int, int)':
 fpath.cpp:583:15: warning: variable 'r' set but not used [-Wunused-but-
 set-variable]
 g++ -DHAVE_CONFIG_H -I. -I..  -D_GNU_SOURCE=1 -D_REENTRANT
 -I/usr/include/SDL    -I/usr/include/libpng12    -D__STDC_FORMAT_MACROS
 -D__STDC_
 LIMIT_MACROS -DNDEBUG -DWZ_DATADIR="\"/usr/share/games/warzone2100\""
 -DLOCALEDIR="\"/usr/share/locale\"" -I.. -I../tools -I. -I../lib/frame
 work -DQT_SHARED -I/usr/include/qt4 -I/usr/include/qt4/QtCore
 -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtScript
 -D_FORTIFY_SOURCE=2
   -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat
 -Werror=format-security -fstack-protector -c -o qtscripttest.o qtscriptt
 est.cpp
 modeltest.c: In function 'check_pie':
 modeltest.c:66:3: warning: implicit declaration of function 'getcwd'
 [-Wimplicit-function-declaration]
 modeltest.c:66:3: warning: format '%s' expects argument of type 'char *',
 but argument 4 has type 'int' [-Wformat]
 modeltest.c:127:4: warning: format '%f' expects argument of type 'float
 *', but argument 3 has type 'double *' [-Wformat]
 modeltest.c:127:4: warning: format '%f' expects argument of type 'float
 *', but argument 4 has type 'double *' [-Wformat]
 modeltest.c:127:4: warning: format '%f' expects argument of type 'float
 *', but argument 5 has type 'double *' [-Wformat]
 modeltest.c:201:5: warning: format '%f' expects argument of type 'float
 *', but argument 3 has type 'double *' [-Wformat]
 modeltest.c:201:5: warning: format '%f' expects argument of type 'float
 *', but argument 4 has type 'double *' [-Wformat]
 modeltest.c: In function 'main':
 modeltest.c:247:3: warning: format '%s' expects argument of type 'char *',
 but argument 3 has type 'char (*)[4096]' [-Wformat]
 modeltest.c:247:9: warning: ignoring return value of 'fscanf', declared
 with attribute warn_unused_result [-Wunused-result]
 g++ -DHAVE_CONFIG_H -I. -I..  -D_GNU_SOURCE=1 -D_REENTRANT
 -I/usr/include/SDL    -I/usr/include/libpng12    -D__STDC_FORMAT_MACROS
 -D__STDC_LIMIT_MACROS -DNDEBUG
 -DWZ_DATADIR="\"/usr/share/games/warzone2100\""
 -DLOCALEDIR="\"/usr/share/locale\"" -I.. -I../tools -I. -I../lib/framework
 -DQT_SHARED -I/usr/include/qt4 -I/usr/include/qt4/QtCore
 -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtScript
 -D_FORTIFY_SOURCE=2  -g -O2 -fPIE -fstack-protector --param=ssp-buffer-
 size=4 -Wformat -Werror=format-security -fstack-protector -c -o lint.o
 lint.cpp
 maptest.cpp: In function 'int main(int, char**)':
 maptest.cpp:27:31: warning: format '%s' expects argument of type 'char*',
 but argument 3 has type 'char (*)[4096]' [-Wformat]
 maptest.cpp:27:32: warning: ignoring return value of 'int fscanf(FILE*,
 const char*, ...)', declared with attribute warn_unused_result [-Wunused-
 result]
 gcc -std=gnu99 -g -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4
 -Wformat -Werror=format-security -fstack-protector  -lz -rdynamic -fPIE
 -pie -Wl,-z,relro -Wl,-z,now -o modeltest modeltest.o
 qtscripttest.cpp: In function 'int main(int, char**)':
 qtscripttest.cpp:24:31: warning: format '%s' expects argument of type
 'char*', but argument 3 has type 'char (*)[4096]' [-Wformat]
 qtscripttest.cpp:24:32: warning: ignoring return value of 'int
 fscanf(FILE*, const char*, ...)', declared with attribute
 warn_unused_result [-Wunused-result]

-- 
Ticket URL: <http://developer.wz2100.net/ticket/3499>
Warzone 2100 Trac <http://developer.wz2100.net/>
The Warzone 2100 Project
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Warzone2100-project mailing list
Warzone2100-project@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/warzone2100-project

Reply via email to