parens around sizeof arg

Brandon Allbery bsa at ncoast.UUCP
Sun Feb 24 07:11:40 AEST 1985


> Article <8048 at brl-tgr.ARPA>, from cottrell at nbs-vms.ARPA
+----------------
| /*
| > > (Hey, (guys), let's (not) put extra (parentheses (everywhere)))!
| > > sizeof thing
| > > sizeof(type)
| > 
| > Strictly speaking, that is correct syntax.  Still, C allows one to
| > parenthesise any expression.  Because "operators" like 'sizeof' and
| > 'return' are made up of letters, I like to put their operands in
| > parentheses.  Purely visual (not even syntactic) sugar.		;-)
| > 
| > Joe Yao		hadron!jsdy at seismo.{ARPA,UUCP}
| 
| I have to agree with Joe here. I think of sizeof as a compile-time
| funxion. Thus the args. Purely style.
| */

Style for you guys, necessity for others.  The only time I use sizeof is
in such expressions as, "sizeof(struct foo)"; and our compiler doesn't
realize that "struct" gets a following name, so "sizeof struct foo" gets
me a syntax error.

--bsa
-- 
Brandon Allbery, decvax!cwruecmp!ncoast!bsa, ncoast!bsa at case.csnet (etc.)
6504 Chestnut Road Independence, Ohio 44131 +1 216 524 1416 (or what have you)
		 -=> Does the Doctor make house calls? <=-



More information about the Comp.lang.c mailing list