diff mbox

[buildrobot] PR59496: Fix unused variable warning

Message ID 20140114165911.GA24303@lug-owl.de
State New
Headers show

Commit Message

Jan-Benedict Glaw Jan. 14, 2014, 4:59 p.m. UTC
Hi!

In the buildrobot's logs for building with config-list.mk, I noticed
this warning:

g++ -c  -DIN_GCC_FRONTEND -DIN_GCC_FRONTEND -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common  -DHAVE_CONFIG_H -I. -Ic-family -I../../../gcc/gcc -I../../../gcc/gcc/c-family -I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include -I/opt/cfarm/mpc/include  -I../../../gcc/gcc/../libdecnumber -I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../../gcc/gcc/../libbacktrace    -o c-family/c-common.o -MT c-family/c-common.o -MMD -MP -MF c-family/.deps/c-common.TPo ../../../gcc/gcc/c-family/c-common.c
../../../gcc/gcc/c-family/c-common.c: In function ‘tree_node* c_sizeof_or_alignof_type(location_t, tree, bool, bool, int)’:
../../../gcc/gcc/c-family/c-common.c:5007:9: error: unused variable ‘field’ [-Werror=unused-variable]
    tree field = build_decl (UNKNOWN_LOCATION, FIELD_DECL, NULL_TREE,
         ^
cc1plus: all warnings being treated as errors
make[2]: *** [c-family/c-common.o] Error 1

There were additional comments on the PR recently, I suggest this
patch to plug it:

2014-01-14  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

	PR bootstrap/59496
	* config/rs6000/darwin.h (ADJUST_FIELD_ALIGN): Fix unused variable
	warning.

Comments

Jakub Jelinek Jan. 20, 2014, 8:45 a.m. UTC | #1
On Tue, Jan 14, 2014 at 05:59:11PM +0100, Jan-Benedict Glaw wrote:
> 2014-01-14  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
> 
> 	PR bootstrap/59496
> 	* config/rs6000/darwin.h (ADJUST_FIELD_ALIGN): Fix unused variable
> 	warning.

Ok, thanks.

> diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
> index 43a2ab5..fc1f862 100644
> --- a/gcc/config/rs6000/darwin.h
> +++ b/gcc/config/rs6000/darwin.h
> @@ -328,9 +328,10 @@ extern int darwin_emit_branch_islands;
>     behavior is dealt with by
>     darwin_rs6000_special_round_type_align.  */
>  #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED)	\
> -  (TARGET_ALIGN_NATURAL ? (COMPUTED)		\
> -   : (COMPUTED) == 128 ? 128			\
> -   : MIN ((COMPUTED), 32))
> +  ((void) (FIELD),				\
> +   (TARGET_ALIGN_NATURAL ? (COMPUTED)		\
> +    : (COMPUTED) == 128 ? 128			\
> +    : MIN ((COMPUTED), 32)))
>  
>  /* Darwin increases natural record alignment to doubleword if the first
>     field is an FP double while the FP fields remain word aligned.  */
> 

	Jakub
diff mbox

Patch

diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index 43a2ab5..fc1f862 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -328,9 +328,10 @@  extern int darwin_emit_branch_islands;
    behavior is dealt with by
    darwin_rs6000_special_round_type_align.  */
 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED)	\
-  (TARGET_ALIGN_NATURAL ? (COMPUTED)		\
-   : (COMPUTED) == 128 ? 128			\
-   : MIN ((COMPUTED), 32))
+  ((void) (FIELD),				\
+   (TARGET_ALIGN_NATURAL ? (COMPUTED)		\
+    : (COMPUTED) == 128 ? 128			\
+    : MIN ((COMPUTED), 32)))
 
 /* Darwin increases natural record alignment to doubleword if the first
    field is an FP double while the FP fields remain word aligned.  */