This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Fix C99-ism in gas/subsegs.c


Found with an apparently old-enough gcc (RH 7.3):

gcc -DHAVE_CONFIG_H -I. -I/h/hp/binutils/cvs_latest/src/gas -I. -D_GNU_SOURCE -I. -I/h/hp/binutils/cvs_latest/src/gas -I../bfd -I/h/hp/binutils/cvs_latest/src/gas/config -I/h/hp/binutils/cvs_latest/src/gas/../include -I/h/hp/binutils/cvs_latest/src/gas/.. -I/h/hp/binutils/cvs_latest/src/gas/../bfd -I/h/hp/binutils/cvs_latest/src/gas/../intl -I../intl -DLOCALEDIR="\"/usr/local/share/locale\""   -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c /h/hp/binutils/cvs_latest/src/gas/subsegs.c
/h/hp/binutils/cvs_latest/src/gas/subsegs.c: In function `subseg_change':
/h/hp/binutils/cvs_latest/src/gas/subsegs.c:80: parse error before `*'
/h/hp/binutils/cvs_latest/src/gas/subsegs.c:85: `seginfo' undeclared (first use in this function)
/h/hp/binutils/cvs_latest/src/gas/subsegs.c:85: (Each undeclared identifier is reported only once
/h/hp/binutils/cvs_latest/src/gas/subsegs.c:85: for each function it appears in.)
cc1: warnings being treated as errors
/h/hp/binutils/cvs_latest/src/gas/subsegs.c:99: warning: left-hand operand of comma expression has no effect
/h/hp/binutils/cvs_latest/src/gas/subsegs.c:99: warning: statement with no effect

I thought there were have warnings enabled that should catch this?
Committed as obvious.

gas:
	* subsegs.c (subseg_change): Move declaration of seginfo to before
	first statement.


Index: subsegs.c
===================================================================
RCS file: /cvs/src/src/gas/subsegs.c,v
retrieving revision 1.26
diff -u -p -r1.26 subsegs.c
--- subsegs.c	11 Aug 2005 01:25:20 -0000	1.26
+++ subsegs.c	11 Aug 2005 16:16:31 -0000
@@ -75,9 +75,9 @@ subsegs_begin (void)
 void
 subseg_change (register segT seg, register int subseg)
 {
+  segment_info_type *seginfo;
   now_seg = seg;
   now_subseg = subseg;
-  segment_info_type *seginfo;
 
   if (now_seg == absolute_section)
     return;

brgds, H-P


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