www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/21/10:39:06

Date: Thu, 21 Nov 1996 17:21:49 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
Cc: DJGPP AT delorie DOT com
Subject: Re: v2 unwanted warnings
In-Reply-To: <EF21E372FE@fs2.mt.umist.ac.uk>
Message-Id: <Pine.SUN.3.91.961121171018.24365D-100000@is>
Mime-Version: 1.0

On Thu, 21 Nov 1996, A.Appleyard wrote:

>   (0) About how many messages are there per day now on djgpp email group?

Can you read Usenet News?  If so, you can just read the 
comp.os.msdos.djgpp news group whenever you have time.  All DJGPP 
messages are automaticvally reflected there.

> is stuffed out with hundreds of `warning: unused parameter' warning lines.
> How to stop these warning and still use -Wall for its other useful properties?

Try this (it's in the gcc docs, btw):

	gcc -Wall -Wno-unused ...

However, -Wno-unused also shuts up gcc in other cases (such as whenever a
function is declared static but never defined, whenever a label is
declared but not used, and whenever a statement computes a result that is
explicitly not used), and you might still want those.  So you might
consider pacifying -Wall by other means.  One simple way is this: 

	void myfunc (int var1, int var2, int var3)
	{
	   var2 = var2;  /* unused, pacify -Wall */
	   ....

There are other methods, all documented in the gcc docs (such as the 
`unused' attribute), but most of them are gcc-specific and won't do if 
you need your program to compile with other compilers.  The above trick 
will always work.

>   (2) Can this warning be suppressed specifically, similarly?:-
>     `warning: suggest parentheses around assignment used as truth value'

Use -Wno-parentheses.

I don't know about the last one, since I never push C that far.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019