A patch for "statement with no effect" warnings in intl calls

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Sat Mar 13 10:21:00 GMT 1999


 > From: Mark Mitchell <mark@markmitchell.com>
 > 
 > >>>>> "Kaveh" == Kaveh R Ghazi <ghazi@caip.rutgers.edu> writes:
 > 
 >     Kaveh> The solution I used was to cast the expression to (void).
 > 
 > This is in direct violation of the GNU Coding Standards.
 > -- 
 > Mark Mitchell 			mark@markmitchell.com


	No its not.  The guidelines about casts to void are raised in the
context of not "placating lint" which could make your program "ugly".

	Lint requires you to cast to void >every single function call<
which returns a value which you don't use.  (I agree that's ugly.)

	My use of void casts is in the context of silencing a gcc
warning, not lint.  The gcc documentation itself suggests using void
casts for this warning, and we have an established practice of doing so. 

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


More information about the Gcc-patches mailing list