Warnings (was: Semi constant expressions)
Mark Brader
msb at sq.sq.com
Wed Sep 6 04:13:31 AEST 1989
> > > 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 at sq.com after simple carelessness." -- John Woods
This article is in the public domain.
More information about the Comp.std.c
mailing list