This is the mail archive of the gcc-bugs@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]

dead code elim && div-by-0 warnings


Couple of things..

foo()
{
	if (0)
		bar("string");
}

will still put "string" into the output, although it is unreferenced.

Also,

int foo(int i)
{
	return i / 0;
}

I'd suggest that a warning be generated for this.  (Bearing in mind that
'0' could be the result of a complex macro expansion and not obvious).

Thanks.

-- 
-akpm-

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