Some warnings compiled with gcc 4.6.3

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

$B!!(Bgcc 4.6.3 $B$G%S%k%I$7$?$i$$$/$D$+(B warning
$B$,=P$?$N$G$4Js9p$G$9!%(B

io.c:
compiling …/trunk/io.c
…/trunk/io.c: $B4X?t(B $B!F(Bio_encoding_set$B!G(B $BFb(B:
…/trunk/io.c:8789:9: $B7Y9p(B: $B;HMQ$5$l$J$$JQ?t(B $B!F(Btmp1$B!G(B
$B$G$9(B [-Wunused-variable]
…/trunk/io.c:8797:9: $B7Y9p(B: $B;HMQ$5$l$J$$JQ?t(B $B!F(Btmp1$B!G(B
$B$G$9(B [-Wunused-variable]

$B3:EvItJ,!’(B
8787 if (enc == enc2) {
8788 /* Special case - “-” => no transcoding */
8789 VALUE tmp1 = rb_check_string_type(v1);
8790 enc2 = NULL;
8791 }

8795 if (enc == enc2) {
8796 /* Special case - “-” => no transcoding */
8797 VALUE tmp1 = rb_check_string_type(v1);
8798 enc2 = NULL;
8799 }

$B!!$?$7$+$K(B tmp1 $B$OITMW$K8+$($^$9!%$3$l!$(Bv1
$B$r%A%’%C%/[email protected]$1!)(B

regparse.c:
compiling …/trunk/regparse.c
…/trunk/regparse.c: $B4X?t(B $B!F(Bparse_exp$B!G(B $BFb(B:
…/trunk/regparse.c:5734:37: $B7Y9p(B: $B!F(Bb2$B!G(B
$B$O$3$N4X?tFb=i4|2=$5$l$:$K;HMQ$5(B
$B$l$k$+$b$7$l$^$;$s(B [-Wuninitialized]
…/trunk/regparse.c:5690:12: $BHw9M(B: $B!F(Bb2$B!G(B
$B$O$3$3$GDj5A$5$l$F$$$^$9(B
…/trunk/regparse.c:1501:7: $B7Y9p(B: $B!F(Bc$B!G(B
$B$O$3$N4X?tFb=i4|2=$5$l$:$K;HMQ$5$l(B
$B$k$+$b$7$l$^$;$s(B [-Wuninitialized]
…/trunk/regparse.c:5687:17: $BHw9M(B: $B!F(Bc$B!G(B
$B$O$3$3$GDj5A$5$l$F$$$^$9(B

$B!!%3!<%I$r8+$?$s$G$9$,[email protected]$,$"$k$+$b!$(B
$B$H;W$$$^$7$?!%$,!$0U?^E*$K$3$&$d$C$F$k$N$+$b$H$$$&5$$b$7$^$9!%0U?^E*$J(B
$B$i!$][email protected]@ItJ,$G(B 0 $B$G$bBeF~$7$FM_$7$$$H$3$m!%(B

addr2line.c:

compiling …/trunk/addr2line.c
…/trunk/addr2line.c: $B4X?t(B $B!F(Bparse_debug_line_cu$B!G(B $BFb(B:
…/trunk/addr2line.c:235:18: $B7Y9p(B: $BJQ?t(B $B!F(Bisa$B!G(B
$B$,@_Dj$5$l$^$7$?$,;HMQ$5$l$F$$$^$;(B
$B$s(B [-Wunused-but-set-variable]
…/trunk/addr2line.c:232:9: $B7Y9p(B: $BJQ?t(B $B!F(Bend_sequence$B!G(B
$B$,@_Dj$5$l$^$7$?$,;HMQ$5$l(B
$B$F$$$^$;$s(B [-Wunused-but-set-variable]
…/trunk/addr2line.c:231:9: $B7Y9p(B: $BJQ?t(B $B!F(Bbasic_block$B!G(B
$B$,@_Dj$5$l$^$7$?$,;HMQ$5$l(B
$B$F$$$^$;$s(B [-Wunused-but-set-variable]
…/trunk/addr2line.c:229:18: $B7Y9p(B: $BJQ?t(B $B!F(Bcolumn$B!G(B
$B$,@_Dj$5$l$^$7$?$,;HMQ$5$l$F$$(B
$B$^$;$s(B [-Wunused-but-set-variable]
…/trunk/addr2line.c:223:20: $B7Y9p(B: $BJQ?t(B
$B!F(Bstandard_opcode_lengths$B!G(B $B$,@_Dj$5$l$^$7(B
$B$?$,;HMQ$5$l$F$$$^$;$s(B [-Wunused-but-set-variable]

$B!!3HD%%i%$%V%i%j$+$i$b7k9=7Y9p$,=P$^$9$M!%:Y$+$/$O8+$F$$$^$;(B
$B$s!%(Bbigdecimal.c $B$OBt;3$"$C$F]5F+$7$$$+$iD>$k$HNI$$$J$!!%(B

…/…/…/trunk/ext/bigdecimal/bigdecimal.c:634:5: $B7Y9p(B: $BJQ?t(B
$B!F(BvStack$B!G(B $B$,@_Dj$5$l$^$7$?$,;HMQ$5$l$F$$$^$;$s(B
[-Wunused-but-set-variable]
…/…/…/trunk/ext/bigdecimal/bigdecimal.c: $B4X?t(B $B!F(BBigDecimal_neg$B!G(B
$BFb(B:
…/…/…/trunk/ext/bigdecimal/bigdecimal.c:1258:5: $B7Y9p(B: $BJQ?t(B
$B!F(BvStack$B!G(B $B$,@_Dj$5$l$^$7$?$,;HMQ$5$l$F$$$^$;$s(B
[-Wunused-but-set-variable]
…/…/…/trunk/ext/bigdecimal/bigdecimal.c: $B4X?t(B
$B!F(BBigDecimal_mult2$B!G(B $BFb(B:
…/…/…/trunk/ext/bigdecimal/bigdecimal.c:1582:5: $B7Y9p(B: $BJQ?t(B
$B!F(BvStack$B!G(B $B$,@_Dj$5$l$^$7$?$,;HMQ$5$l$F$$$^$;$s(B
[-Wunused-but-set-variable]
…/…/…/trunk/ext/bigdecimal/bigdecimal.c: $B4X?t(B
$B!F(BBigDecimal_inspect$B!G(B $BFb(B:
…/…/…/trunk/ext/bigdecimal/bigdecimal.c:1884:5: $B7Y9p(B: $BJQ?t(B
$B!F(BvStack$B!G(B $B$,@_Dj$5$l$^$7$?$,;HMQ$5$l$F$$$^$;$s(B
[-Wunused-but-set-variable]
…/…/…/trunk/ext/bigdecimal/bigdecimal.c: $B4X?t(B
$B!F(BBigDecimal_power$B!G(B $BFb(B:
…/…/…/trunk/ext/bigdecimal/bigdecimal.c:2026:5: $B7Y9p(B: $BJQ?t(B
$B!F(BvStack$B!G(B $B$,@_Dj$5$l$^$7$?$,;HMQ$5$l$F$$$^$;$s(B
[-Wunused-but-set-variable]

compiling …/…/…/…/trunk/ext/json/generator/generator.c
…/…/…/…/trunk/ext/json/generator/generator.c: $B4X?t(B
$B!F(BcState_aref$B!G(B $BFb(B:
…/…/…/…/trunk/ext/json/generator/generator.c:632:5: $B7Y9p(B: $BJQ?t(B
$B!F(Bstate$B!G(B $B$,@_Dj$5$l$^$7$?$,;HMQ$5$l$F$$$^$;$s(B
[-Wunused-but-set-variable]

compiling …/…/…/…/trunk/ext/json/parser/parser.c
…/…/…/…/trunk/ext/json/parser/…/fbuffer/fbuffer.h:130:13: $B7Y9p(B:
$B!F(Bfbuffer_append_long$B!G(B $B$,Dj5A$5$l$^$7$?$,;HMQ$5$l$^$;$s(B
[-Wunused-function]
…/…/…/…/trunk/ext/json/parser/…/fbuffer/fbuffer.h:137:17: $B7Y9p(B:
$B!F(Bfbuffer_dup$B!G(B $B$,Dj5A$5$l$^$7$?$,;HMQ$5$l$^$;$s(B [-Wunused-function]
…/…/…/…/trunk/ext/json/parser/…/fbuffer/fbuffer.h:150:14: $B7Y9p(B:
$B!F(Bfbuffer_to_s$B!G(B $B$,Dj5A$5$l$^$7$?$,;HMQ$5$l$^$;$s(B [-Wunused-function]
…/…/…/…/trunk/ext/json/parser/…/fbuffer/fbuffer.h:91:13: $B7Y9p(B:
$B!F(Bfbuffer_append_str$B!G(B $B$,Dj5A$5$l$^$7$?$,;HMQ$5$l$^$;$s(B
[-Wunused-function]

compiling …/…/…/trunk/ext/nkf/nkf.c
…/…/…/trunk/ext/nkf/nkf.c: $B4X?t(B $B!F(Brb_nkf_convert$B!G(B $BFb(B:
…/…/…/trunk/ext/nkf/nkf.c:138:20: $B7Y9p(B: $BJQ?t(B $B!F(Btmp$B!G(B
$B$,@_Dj$5$l$^$7$?$,;HMQ$5$l$F$$$^$;$s(B [-Wunused-but-set-variable]

compiling …/…/…/trunk/ext/socket/ancdata.c
…/…/…/trunk/ext/socket/ancdata.c: $B4X?t(B $B!F(Bbsock_sendmsg_internal$B!G(B
$BFb(B:
…/…/…/trunk/ext/socket/ancdata.c:1168:13: $B7Y9p(B: $BJQ?t(B
$B!F(Blast_type$B!G(B $B$,@_Dj$5$l$^$7$?$,;HMQ$5$l$F$$$^$;$s(B
[-Wunused-but-set-variable]
…/…/…/trunk/ext/socket/ancdata.c:1167:13: $B7Y9p(B: $BJQ?t(B
$B!F(Blast_level$B!G(B $B$,@_Dj$5$l$^$7$?$,;HMQ$5$l$F$$$^$;$s(B
[-Wunused-but-set-variable]

compiling …/…/…/trunk/ext/syck/rubyext.c
…/…/…/trunk/ext/syck/rubyext.c: $B4X?t(B $B!F(Bsyck_seq_initialize$B!G(B
$BFb(B:
…/…/…/trunk/ext/syck/rubyext.c:1529:15: $B7Y9p(B: $BJQ?t(B $B!F(Bnode$B!G(B
$B$,@_Dj$5$l$^$7$?$,;HMQ$5$l$F$$$^$;$s(B [-Wunused-but-set-variable]

$BA0ED$G$9!#(B

$B:#99$G$9$,!"(B

2012$BG/(B5$B7n(B6$BF|(B 19:09 SASADA Koichi [email protected]:

$B!!3HD%%i%$%V%i%j$+$i$b7k9=7Y9p$,=P$^$9$M!%:Y$+$/$O8+$F$$$^$;(B
$B$s!%(Bbigdecimal.c $B$OBt;3$"$C$F]5F+$7$$$+$iD>$k$HNI$$$J$!!%(B

compiling …/…/…/trunk/ext/bigdecimal/bigdecimal.c
…/…/…/trunk/ext/bigdecimal/bigdecimal.c: $B4X?t(B
$B!F(BBigDecimal_prec$B!G(B $BFb(B:

…/…/…/trunk/ext/bigdecimal/bigdecimal.c:305:5: $B7Y9p(B: $BJQ?t(B
$B!F(BvStack$B!G(B $B$,@_Dj$5$l$^$7$?$,;HMQ$5$l$F$$$^$;$s(B
[-Wunused-but-set-variable]

$B$3$l!"(BGC$BBP:[email protected][email protected]$1$7$F;2>H$7$J$$$N$O0U?^$I$*$j$J$s$G$9$h$M(B?
$B0J2<$N$h$&$K7Y9p$rM^@)$7$F$7$^$C$F$O$^$:$$$G$7$g$&$+(B?

— a/ext/bigdecimal/extconf.rb
+++ b/ext/bigdecimal/extconf.rb
@@ -3,4 +3,8 @@ require ‘mkmf’
have_func(“labs”, “stdlib.h”)
have_func(“llabs”, “stdlib.h”)

+if CONFIG[“GCC”] == “yes”

  • $warnflags += " -Wno-unused-but-set-variable"
    +end

create_makefile(‘bigdecimal’)

$BA0ED$G$9!#(B

2012$BG/(B12$B7n(B11$BF|(B 15:01 Shugo M. [email protected]:

  • $warnflags += " -Wno-unused-but-set-variable"
    +end

create_makefile(‘bigdecimal’)

[email protected]$H8E$$(Bgcc$B$G$^$:$$$N$G$3$s$J46$8$G$9$+$M(B

— a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -59,8 +59,18 @@ static ID id_floor;
static ID id_to_r;
static ID id_eq;

+#define GCC_VERSION_SINCE(major, minor, patchlevel) \

  • (defined(GNUC) && !defined(__INTEL_COMPILER) && \
  • ((GNUC > (major)) || \
  • (GNUC == (major) && GNUC_MINOR > (minor)) || \
  • (GNUC == (major) && GNUC_MINOR == (minor) &&
    GNUC_PATCHLEVEL >= (patchlevel))))

/* MACRO’s to guard objects from GC by keeping them in stack */
+#if GCC_VERSION_SINCE(4,3,0)
+#define ENTER(n) volatile VALUE vStack[n] attribute ((unused));int
iStack=0
+#else
#define ENTER(n) volatile VALUE vStack[n];int iStack=0
+#endif
#define PUSH(x) vStack[iStack++] = (VALUE)(x);
#define SAVE§ PUSH(p->obj);
#define GUARD_OBJ(p,y) {p=y;SAVE§;}

$BA0ED$G$9!#(B

2012/12/11 Shugo M. [email protected]:

$B$3$l!"(BGC$BBP:[email protected][email protected]$1$7$F;2>H$7$J$$$N$O0U?^$I$*$j$J$s$G$9$h$M(B?
$B0J2<$N$h$&$K7Y9p$rM^@)$7$F$7$^$C$F$O$^$:$$$G$7$g$&$+(B?

regenc.{h,c}$B$G(B__attribute__
((unused))$B$r$9$G$K;H$C$F$$$k$h$&[email protected]$C$?$N$G!"(Bruby.h$B$K(BRB_UNUSED_VAR()
$B$H$$$&%^%/%m$rDI2C$7$F!"(Bbigdecimal.c$B$G$=$l$r;H$C$F7Y9p$rM^@)$9$k$h$&$K$7$^$7$?!#(B
gcc 4.6.0$B$h$jA0$N%P!<%8%g%s$G(B__attribute__
((unused))$B$rIU$1$F$b32$O$J$$$H;W$&$N$G%P!<%8%g%s$N%A%’%C%/$O(B
$BF~$l$F$$$^$;$s!#(B

$B$9$G$K(Bregenc.h$B$G(B__GNUC__$B$,Dj5A$5$l$F$$$?$i(B__attribute__

((unused))$B$r;H$C$F$$$k$N$GLdBj$J$$$H(B

$BH=CG$7$^$7$?!#(B

regenc.{h,c}$B$NJ}$O$"$^$j$$$8$i$J$$J}$,[email protected]$m$&$H;W$C$F%^%/%m$O6&DL2=$;$:$K$=$N$^$^$K$7$F$"$j$^$9!#(B

$B$"$H!"(Bext/json/generator.c$B$G$bF1$87Y9p$,=P$F$$$^$9$,!"$3$A$i$O7Y9p$K=>$C$F(BGET_STATE(self);$B$r(B
$B>C$7$?$i$$$$$h$&$K;W$$$^$9!#(B

compiling generator.c
generator.c: $B4X?t(B $B!F(BcState_aref$B!G(B $BFb(B:
generator.c:632:5: $B7Y9p(B: $BJQ?t(B $B!F(Bstate$B!G(B
$B$,@_Dj$5$l$^$7$?$,;HMQ$5$l$F$$$^$;$s(B [-Wunused-but-set-variable]

$B$3$C$A$O(Bhttps://github.com/flori/json$B$K(Bpull
request$BAw$k$N$,$$$$$s$G$9$+$M$(!#(B

2012$BG/(B12$B7n(B13$BF|(B 13:03 Shugo M. [email protected]:

$B$"$H!"(Bext/json/generator.c$B$G$bF1$87Y9p$,=P$F$$$^$9$,!"$3$A$i$O7Y9p$K=>$C$F(BGET_STATE(self);$B$r(B

$B>C$7$?$i$$$$$h$&$K;W$$$^$9!#(B

compiling generator.c
generator.c: $B4X?t(B $B!F(BcState_aref$B!G(B $BFb(B:
generator.c:632:5: $B7Y9p(B: $BJQ?t(B $B!F(Bstate$B!G(B
$B$,@_Dj$5$l$^$7$?$,;HMQ$5$l$F$$$^$;$s(B [-Wunused-but-set-variable]

$B$3$C$A$O(Bhttps://github.com/flori/json$B$K(Bpull
request$BAw$k$N$,$$$$$s$G$9$+$M$(!#(B

$B$=$&$7$FD:$1$k$H=u$+$j$^$9!#(B

$BA0ED$G$9!#(B

2012$BG/(B12$B7n(B13$BF|(B 14:01 NARUSE, Yui [email protected]:

compiling generator.c
generator.c: $B4X?t(B $B!F(BcState_aref$B!G(B $BFb(B:
generator.c:632:5: $B7Y9p(B: $BJQ?t(B $B!F(Bstate$B!G(B
$B$,@_Dj$5$l$^$7$?$,;HMQ$5$l$F$$$^$;$s(B [-Wunused-but-set-variable]

$B$3$C$A$O(Bhttps://github.com/flori/json$B$K(Bpull
request$BAw$k$N$,$$$$$s$G$9$+$M$(!#(B

$B$=$&$7$FD:$1$k$H=u$+$j$^$9!#(B

$BAw$C$F$*$-$^$7$?!#(B

https://github.com/flori/json/pull/153

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs