[comp.std.c] Warnings

msb@sq.sq.com (Mark Brader) (09/06/89)

> > >	x << (100000000L)	/* Non-conforming, see 3.3.7 */
> > By the way, the L on the right operand has no effect.  ...
> > and the plain constant 100000000 would be [int] or [long] depending on the
> > size of ints.
> But a good compiler might warn you if you say "100000000" and it gets promoted
> to long.

Well, an even better compiler might do this only in a context where it
matters whether int or long is used.  In an example such as the above or
such as "long johns = 100000000;", the type of the constant is irrelevant.

-- 
Mark Brader			"'You wanted it to WORK?  That costs EXTRA!'
SoftQuad Inc., Toronto		 is probably the second-place security hole
utzoo!sq!msb, msb@sq.com	 after simple carelessness."	-- John Woods

This article is in the public domain.