-Wall

[email protected]$G$9!%e(B

e$B!!:G6a!$e(Bgcc e$B$Ne(B -Wall
e$B$NB8:$rK:$l$F$$$?$H$3$m!$$=$l$r$d$C$F$$$l$P5$e(B
e$B$,$D$$$?$O$:$N%P%0$K5$$E$+$:$K%3%
%C%H$7$F$^$$!$K?KNIt7/$K;6!9E$i$le(B
e$B$^$7$?!%e(B

e$B!!e(Bconfigure e$B$7$?;[email protected]$G!$%G%U%)%k%H$Ge(B gcc e$B$J$ie(B -Wall
e$B$rIU$1$FM_$7$$5$e(B
e$B$,$9$k$N$G$9$,[email protected]$H$^$:$$;v>p$O$"$j$^$9$G$7$g$&$+!%e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:34810] -Wall”
on Fri, 23 May 2008 01:11:50 +0900, SASADA Koichi [email protected]
writes:

|e$B!!:G6a!$e(Bgcc e$B$Ne(B -Wall e$B$NB8:$rK:$l$F$$$?$H$3$m!$$=$l$r$d$C$F$$$l$P5$e(B
|e$B$,$D$$$?$O$:$N%P%0$K5$$E$+$:$K%3%
%C%H$7$F$^$$!$K?KNIt7/$K;6!9E$i$le(B
|e$B$^$7$?!%e(B
|
|e$B!!e(Bconfigure e$B$7$?;[email protected]$G!$%G%U%)%k%H$Ge(B gcc e$B$J$ie(B -Wall e$B$rIU$1$FM_$7$$5$e(B
|e$B$,$9$k$N$G$9$,[email protected]$H$^$:$$;v>p$O$"$j$^$9$G$7$g$&$+!%e(B

-Walle$B$O;d$N%9%?%$%ke(B(e$B>r7o<0$KBeF~$r=q$/e(B)e$B$KJ86g$rIU$1$k$N$G5$e(B
e$BJ,$,0-$$!"$H$$$&0J30$K$O$^$:$$$3$H$O;W$$$D$-$^$;$s!#e(B

e$BLZB<$G$9!#e(B

Yukihiro M. e$B$5$s$O=q$-$^$7$?e(B (2008/05/23 1:25):

|e$B!!e(Bconfigure e$B$7$?;[email protected]$G!$%G%U%)%k%H$Ge(B gcc e$B$J$ie(B -Wall e$B$rIU$1$FM_$7$$5$e(B
|e$B$,$9$k$N$G$9$,[email protected]$H$^$:$$;v>p$O$"$j$^$9$G$7$g$&$+!%e(B

-Walle$B$O;d$N%9%?%$%ke(B(e$B>r7o<0$KBeF~$r=q$/e(B)e$B$KJ86g$rIU$1$k$N$G5$e(B
e$BJ,$,0-$$!"$H$$$&0J30$K$O$^$:$$$3$H$O;W$$$D$-$^$;$s!#e(B

if ((foo = bar)) {

e$B$N$h$&$K=q$1$PL[$C$F$$$?$H;W$$$^$9$,!"$3$N2sHr:v$b5Q2<!#$G$9$h$M!#e(B

e$B:XF#$H?=$7$^$9!#e(B

On Fri, 23 May 2008 01:25:56 +0900
Yukihiro M. [email protected] wrote:

-Walle$B$O;d$N%9%?%$%ke(B(e$B>r7o<0$KBeF~$r=q$/e(B)e$B$KJ86g$rIU$1$k$N$G5$e(B
e$BJ,$,0-$$!"$H$$$&0J30$K$O$^$:$$$3$H$O;W$$$D$-$^$;$s!#e(B

“-Wno-parentheses"e$B$rIU$1$k!”$H$$$&<j$,$"$k$H;W$$$^$9!#<+J,$O$$$D$b!"e(B
-Walle$B$H6&$Ke(BCFLAGSe$B$K;XDj$7$Fe(B./configuree$B$7$F$$$^$9!#e(B

e$B$^$?$5$i$K6/NO$J%*%W%7%g%s$H$7$F!“e(B-Wextra(GCC3e$B$G$Oe(B-W)e$B$,$”$j$^$9!#e(B

e$B$=$NB>e(B-Walle$B$G$OM-8z$K$J$i$J$$J*$NCf$G!“e(BBinary Hacks #42
e$B$K$O0J2<$N$h$&$Je(B
e$B%%W%7%g%s$,>R2p$5$l$F$$$^$7$?!#e(BGCC4.2e$B$Ne(Binfoe$B$+$iLu$7$?J$H6&$K!“0lDL$je(B
e$B:$;$F$_$^$9!#$$$$2C8:$G8m$j$b$”$k$H;W$$$^$9$,!”;29M$K$J$l$P9,$$$G$9!#e(B

e$B!&e(B-Wformat=2
printf()e$B7O$N=q<0;XDjJ8;zNs$,%j%F%i%k$G$J$$!“e(Bstrftime()e$B$,@>Nq$rFs7e$7$+=P$5$J$$!“e(B
e$B$=$NB>=q<0;XDjJ8;zNs$K%;%-%e%j%F%#%j%9%/$,$”$k!”$N$$$:$l$+$N>l9g7Y9pe(B

e$B!&e(B-Wstrict-aliasing=2
“-fstrict-aliasing"e$B$H6&$KMQ$$$k$H!”:GE,2=;~$K2u$l$k$+$b$7$l$J$$%a%b%j$N;H$$J}$re(B
e$B7Y9pe(B ([email protected]$$$+$be(B)

e$B!&e(B-Wcast-qual
e$B%-%c%9%H$G7?>pJs$,=|5n$5$l$k>l9g7Y9pe(B(e$B!7e(B)

e$B!&e(B-Wcast-align
e$B%"%i%$%a%s%H$N0[$J$k%]%$%s%?7?$X$N%-%c%9%H$r7Y9pe(B(e$B!7e(B)

e$B!&e(B-Wwrite-strings
e$BJ8;zDj?t$X$N=q$-9~$_$r7Y9pe(B([email protected]@$Ne(Bconste$B$rE0Dl$7$J$$$H!VM-32!W$H$be(B)

e$B!&e(B-Wconversion
e$B0EL[$NJQ49$r?’!9$He(B(^^;)e$B7Y9pe(B

e$B!&e(B-Wfloat-equal
e$B$=$NL>$NDL$j!"IbF0>[email protected]?t$N!Ve(B==e$B!W$r7Y9pe(B

e$B!&e(B-Wpointer-arith
voide$B%]%$%s%?$d4X?t%]%$%s%?$KBP$9$ke(Bsizeof()e$B$K0MB8$9$k%3!<%I$r7Y9pe(B

e$B!&e(B-Wswitch-enum
switche$BJ8$NBP>]$,e(Benume$B$G$"$C$?>l9g!"$=$NCf$G$+$+$l$F$$$Fe(Bcasee$B$+$iO3$l$F$$$kJ*$r7Y9pe(B
(e$B;H$($k$+$be(B?)

pegacorn です。

From: SASADA Koichi [email protected]
Date: Fri, 23 May 2008 01:11:50 +0900
Message-Id: [email protected]
/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 最近,gcc の -Wall の存在を忘れていたところ,それをやっていれば気
がついたはずのバグに気づかずにコミットしてまい,某卜部君に散々怒られ
ました.

 configure した時点で,デフォルトで gcc なら -Wall を付けて欲しい気
がするのですが,それだとまずい事情はありますでしょうか.

めでたく(?)デフォルトで -Wall が付くようになったことですし、
Visual C++ でもデフォルトで -W3 を付けるようにしては
いかがでしょうか?

パッチ>
Index: win32/Makefile.sub
===================================================================
— win32/Makefile.sub (revision 16898)
+++ win32/Makefile.sub (working copy)
@@ -94,6 +94,12 @@
!if !defined(DEBUGFLAGS)
DEBUGFLAGS = -Zi
!endif
+!if !defined(WARNFLAGS)
+WARNFLAGS = -W3
+!if $(MSC_VER) >= 1400
+WARNFLAGS = $(WARNFLAGS) -wd4018 -wd4101 -wd4244
+!endif
+!endif
!if !defined(OPTFLAGS)
!if $(MSC_VER) < 1400
OPTFLAGS = -O2b2xg-
<<

e$B0J2<!"$4;29M$^$G$K!#e(B

In message [email protected]
on Fri, 23 May 2008 02:31:40 +0900,
Tadashi S. [email protected] wrote:

-Walle$B$O;d$N%9%?%$%ke(B(e$B>r7o<0$KBeF~$r=q$/e(B)e$B$KJ86g$rIU$1$k$N$G5$e(B
e$BJ,$,0-$$!"$H$$$&0J30$K$O$^$:$$$3$H$O;W$$$D$-$^$;$s!#e(B

“-Wno-parentheses"e$B$rIU$1$k!”$H$$$&<j$,$"$k$H;W$$$^$9!#<+J,$O$$$D$b!"e(B
-Walle$B$H6&$Ke(BCFLAGSe$B$K;XDj$7$Fe(B./configuree$B$7$F$$$^$9!#e(B
NetBSDe$B$N%=!<%9%D%j!<$G$O!"e(Bmakefilee$B$Ne(BWARNSe$B$,e(B0e$B$h$jBg$-$$$H!"e(B

CFLAGS -Wno-sign-compare -Wno-traditional

LDFLAGS -Wl,–fatal-warnings

1e$B$h$jBg$-$$$H!"e(B

CFLAGSe$B$KDI2Ce(B -Wreturn-type -Wswitch -Wshadow

2e$B$h$jBg$-$$$H!"e(B

CFLAGSe$B$KDI2Ce(B -Wcast-qual -Wwrite-strings
-Wextra -Wno-unused-parameter

CXXFLAGSe$B$KDI2Ce(B -Wold-style-cast
-Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder
-Wno-deprecated -Wno-non-template-friend
-Woverloaded-virtual -Wno-pmf-conversions
-Wsign-promo -Wsynth

3e$B$h$jBg$-$/$F!"e(Bgcc [email protected]$H!"e(B

CFLAGSe$B$KDI2Ce(B std=gnu99

e$B$H$7$F$$$^$9!#$=$7$F!“e(BOpenSSLe$B$N$h$&$J30It$+$i<[email protected]$b$N$r=|$/$H!“e(B
-Werrore$B$b;XDj$5$l$^$9!#e(B(e$B%&%)!<%K%s%0$,$”$k$H!”%+!<%M%k$N%3%s%Q%$%k$,e(B
e$B%(%i!<$H$J$j$^$9!#e(B)