This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: Chill warning questions #2


 > From: Per Bothner <bothner@cygnus.com>
 > 
 > > If you have a moment, would you please try to answer question #1 from
 > > the same message (http://www.cygnus.com/ml/egcs/1998-Oct/0340.html)?
 > 
 > I didn't answer that because I just answered it in a followup
 > to Joe Buck.  Yes, the & should be a &&.

	Ah yes.  That one wasn't cc'ed to me directly so I got it via
the list today.


 > > 	While we're on a role...
 > 
 > (The phrase is "on a roll" (in case it wasn't just a typo).)

	Heh, thanks. :-)  It was a typo.




 > > parse.c: In function `parse_spec_module':
 > > parse.c:547: warning: unused variable `module_name'
 > 
 > We can't just leave out the push_module call.  So I suggest:
 > 
 > -  tree module_name = push_module (set_module_name (label), 1);
 > -  int save_ignoring = ignoring;
 > +  int save_ignoring = ignoring;
 > +  push_module (set_module_name (label), 1);
 > 
 > > parse.c: In function `parse_operand6':
 > > parse.c:3147: warning: unused variable `location'
 > 
 > In this case, it's a place-holder for an unimplemented feature.
 > If we did implement it, we would be using the location.
 > So it does't really matter how we do it.
 > ATTRIBUTE_UNUSED is probably cleanest.
 > 
 > inout.c: In function `init_text_location':
 > inout.c:2224: warning: unused variable `textlength'
 > 
 > I didn't write this code.  But in this case, it looks like text_length
 > has no side effects, so it should be safe to drop the call.
 > 
 > 	--Per Bothner



	Thanks for all the replies.  I installed the following patch
to clean these up.

		--Kaveh


Index: ChangeLog
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/ch/ChangeLog,v
retrieving revision 1.24
diff -u -p -r1.24 ChangeLog
--- ChangeLog	1998/10/14 19:30:02	1.24
+++ ChangeLog	1998/10/15 13:47:41
@@ -1,3 +1,14 @@
+Thu Oct 15 09:25:21 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	* expr.c (build_chill_card): Use &&, not &, when comparing truth
+	values.
+
+	* parse.c (parse_spec_module): Remove unused variable
+	`module_name', but preserve function call from initialization.
+	(parse_operand6): Mark variable `location' with ATTRIBUTE_UNUSED.
+	
+	* inout.c (init_text_location): Remove unused variable `textlength'.
+
 Wed Oct 14 22:19:48 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
 	* typeck.c (build_chill_cast): Fix typo in assignment statement.
Index: expr.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/ch/expr.c,v
retrieving revision 1.4
diff -u -p -r1.4 expr.c
--- expr.c	1998/09/29 18:41:05	1.4
+++ expr.c	1998/10/15 13:47:50
@@ -1372,7 +1372,8 @@ build_chill_card (powerset)
 	{ int size;
 
 	  /* Do constant folding, if possible. */
-	  if (TREE_CODE (powerset) == CONSTRUCTOR & TREE_CONSTANT (powerset)
+	  if (TREE_CODE (powerset) == CONSTRUCTOR
+	      && TREE_CONSTANT (powerset)
 	      && (size = int_size_in_bytes (TREE_TYPE (powerset))) >= 0)
 	    {
 	      int bit_size = size * BITS_PER_UNIT;
Index: parse.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/ch/parse.c,v
retrieving revision 1.4
diff -u -p -r1.4 parse.c
--- parse.c	1998/10/09 10:08:23	1.4
+++ parse.c	1998/10/15 13:47:55
@@ -544,8 +544,9 @@ static void
 parse_spec_module (label)
      tree label;
 {
-  tree module_name = push_module (set_module_name (label), 1);
   int save_ignoring = ignoring;
+
+  push_module (set_module_name (label), 1);
   ignoring = pass == 2;
   FORWARD_TOKEN(); /* SKIP SPEC */
   expect (MODULE, "expected 'MODULE' here");
@@ -3144,7 +3145,7 @@ parse_operand6 ()
 {
   if (check_token (RECEIVE))
     {
-      tree location = parse_primval ();
+      tree location ATTRIBUTE_UNUSED = parse_primval ();
       sorry ("RECEIVE expression");
       return integer_one_node;
     }
Index: inout.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/ch/inout.c,v
retrieving revision 1.3
diff -u -p -r1.3 inout.c
--- inout.c	1998/09/30 16:34:41	1.3
+++ inout.c	1998/10/15 13:48:04
@@ -2221,7 +2221,6 @@ void init_text_location (decl, type)
      tree type;
 {
   tree indexmode = text_indexmode (type);
-  tree textlength = text_length (type);
   unsigned long accessflags = 0;
   unsigned long textflags = IO_TEXTLOCATION;
   tree lowindex = integer_zero_node;


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