Re: warnings in GCC source?

2007-09-06 Thread Andreas Schwab
Basile STARYNKEVITCH <[EMAIL PROTECTED]> writes:

> So is there an easy way to have some acceptable warnings in GCC?

See gcc/Makefile.in, look for -Wno-error.

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


RE: warnings in GCC source?

2007-09-06 Thread Dave Korn
On 06 September 2007 16:55, Basile STARYNKEVITCH wrote:

> 2. generated code: when some C files are generated, it may be hard to
> avoid some warnings, typically a generated C function might have unused
> arguments (which might be not very easy to detect at generation stage).


  Generate "__attribute__ ((unused))" on all parameters/variables, regardless.


cheers,
  DaveK
-- 
Can't think of a witty .sigline today



warnings in GCC source?

2007-09-06 Thread Basile STARYNKEVITCH

Hello All,

In most of GCC source code, it is perfectly normal to expect that no 
warnings should appear, even if the sources are compiled with -Wall or 
more. Actually the GCC bootstrap process seems to require this.


However, I see some occasions where warnings might be quite difficult to 
avoid:


1: DLSYM: This probably should concern the plugin branch (or 
experiment): the POSIX way of getting a routine inside a plug-in is 
dlsym (or which happens to return a pointer, which has to be cast to a 
function pointer somewhere. This cast will get a warning at a certain 
level, like
   warning: ISO C forbids conversion of object pointer to function 
pointer type
This warning cannot be easily avoided. IIRC, some future POSIX standard 
is expected to provide a dlfsym variant to dlsym.


2. generated code: when some C files are generated, it may be hard to 
avoid some warnings, typically a generated C function might have unused 
arguments (which might be not very easy to detect at generation stage).


So is there an easy way to have some acceptable warnings in GCC?

Regards.
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basilestarynkevitchnet mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***