This is the mail archive of the gcc-patches@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: Java warning patches part 2/2


 > From: Per Bothner <bothner@cygnus.com>
 > 
 > +  uint16 minor_version ATTRIBUTE_UNUSED = JCF_readu2 (jcf);
 > +  uint16 major_version ATTRIBUTE_UNUSED = JCF_readu2 (jcf);
 > 
 > I think I prefer this style:
 > 
 > 	(void) JCF_readu2 (jcf);  /* minor_version */
 > 	(void) JCF_readu2 (jcf);  /* major_version */
 > 
 > Otherwise, I have no objection to you checking these in.
 > 	--Per Bothner
 > Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner



	The above suggestion doesn't appear to work, I get a compile
time error.  Note the original patch contents:


--- orig/egcs-CVS19990220/gcc/java/jcf-reader.c	Sat Feb 20 22:27:02 1999
+++ egcs-CVS19990220/gcc/java/jcf-reader.c	Sun Feb 21 13:19:38 1999
@@ -139,8 +139,8 @@ DEFUN(jcf_parse_preamble, (jcf),
       JCF* jcf)
 {
   uint32 magic = (JCF_FILL (jcf, 8), JCF_readu4 (jcf));
-  uint16 minor_version = JCF_readu2 (jcf);
-  uint16 major_version = JCF_readu2 (jcf);
+  uint16 minor_version ATTRIBUTE_UNUSED = JCF_readu2 (jcf);
+  uint16 major_version ATTRIBUTE_UNUSED = JCF_readu2 (jcf);
 #ifdef HANDLE_MAGIC
   HANDLE_MAGIC (magic, minor_version, major_version);
 #endif


	We can't eliminate the variables, because they are used in
HANDLE_MAGIC() but only *sometimes*, i.e. if that macro is defined.

We also can't move them inside the macro test because the calls to
JCF_readu2() still need to be done unconditionally (I assume.)

	So I think we need to retain my patch in its original form.  I
checked in everything as is, hopefully that's okay with you.  If you
still want some alternative, I'll be happy to update it.

		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions


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