public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* system.h & warnings
@ 1998-04-01 22:44 Jeffrey A Law
  0 siblings, 0 replies; 3+ messages in thread
From: Jeffrey A Law @ 1998-04-01 22:44 UTC (permalink / raw)
  To: egcs

I've converted the insn*.c generated files to use system.h.

I've also tweaked genoutput.c so that the generated insn-output.c
does not give warnings about unused parameters.  This kills a couple
hundred warnings on the PA.

If these changes cause any problems, let me know ASAP.

Thanks,
jeff

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: system.h & warnings
  1998-04-02  8:21 Kaveh R. Ghazi
@ 1998-04-04 11:01 ` Jeffrey A Law
  0 siblings, 0 replies; 3+ messages in thread
From: Jeffrey A Law @ 1998-04-04 11:01 UTC (permalink / raw)
  To: Kaveh R. Ghazi; +Cc: egcs, wilson

  In message < 199804021620.LAA18789@caip.rutgers.edu >you write:
  > 	One thing I'd like to bring up, the test you used in genoutput.c
  > to see if __attribute__ should be used only checks __GNUC__.  This can
  > fail for stage1 compilers which are gcc but are older versions.  E.g. 
  > these can be either gcc installed by the user or the default compiler
  > (like maybe nextstep? I'll bet it fails there.)
Good point.


  > 	I'd like to put something in gansidecl.h to do a rigorous test
  > once.  Then one can use __attribute__, or macros based on it, more freely. 
Yes, I think putting this into gansidecl.h would be fine.

However, I don't want to go littering too much of the source code
with attributes.  I don't mind in the generated files because we
very rarely have to look at them :-)

  > 	Should I make a patch to put the following in gansidecl.h?
  > 
  > 		--Kaveh
  > 
  >  > #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
  >  > # define __attribute__(x)
  >  > #endif
  >  > 
  >  > #define ATTRIBUTE_UNUSED __attribute__ ((unused))
  >  > 
  >  > #define ATTRIBUTE_PRINTF(m, n) __attribute__ ((format (__printf__, m, n)
  > ))
  >  > #define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
  >  > #define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
  >  > #define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
Why bother with the ATTRIBUTE_UNUSED macro?  It isn't significantly
simpler or easier to read than __attribute__ ((unused)).

jeff

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re:  system.h & warnings
@ 1998-04-02  8:21 Kaveh R. Ghazi
  1998-04-04 11:01 ` Jeffrey A Law
  0 siblings, 1 reply; 3+ messages in thread
From: Kaveh R. Ghazi @ 1998-04-02  8:21 UTC (permalink / raw)
  To: egcs, law; +Cc: ghazi

 > From: Jeffrey A Law <law@cygnus.com>
 > 
 > I've converted the insn*.c generated files to use system.h.
 > 
 > I've also tweaked genoutput.c so that the generated insn-output.c
 > does not give warnings about unused parameters.  This kills a couple
 > hundred warnings on the PA.
 > 
 > If these changes cause any problems, let me know ASAP.
 > 
 > Thanks,
 > jeff

	Great stuff!

	One thing I'd like to bring up, the test you used in genoutput.c
to see if __attribute__ should be used only checks __GNUC__.  This can
fail for stage1 compilers which are gcc but are older versions.  E.g. 
these can be either gcc installed by the user or the default compiler
(like maybe nextstep? I'll bet it fails there.)

	I'd like to put something in gansidecl.h to do a rigorous test
once.  Then one can use __attribute__, or macros based on it, more freely. 

	Should I make a patch to put the following in gansidecl.h?

		--Kaveh

 > #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
 > # define __attribute__(x)
 > #endif
 > 
 > #define ATTRIBUTE_UNUSED __attribute__ ((unused))
 > 
 > #define ATTRIBUTE_PRINTF(m, n) __attribute__ ((format (__printf__, m, n)))
 > #define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
 > #define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
 > #define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
--
Kaveh R. Ghazi			Project Manager / Custom Development
ghazi@caip.rutgers.edu		Icon CMT Corp.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-04-04 11:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-04-01 22:44 system.h & warnings Jeffrey A Law
1998-04-02  8:21 Kaveh R. Ghazi
1998-04-04 11:01 ` Jeffrey A Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).