[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA-user: Random thoughts on the future interface of PCB
> Parentheses around a constant are nonsense - there is nothing a plain number
> could evaluate to in the preprocessor than itself (unless you "#define 1e20 (foo * i++)"),
> so it has the highest precedence by itself. (couldn't you even "#define (1e20) foo*i++" ?;-)
Not knowing how the #define could be used in all cases it is better to
put parentheses around such usages to have the compiler generate an
error, rather than silently give the wrong value in corner cases where
operators like multiplication and division are passed as parameters to
an other macro.
http://gimpel-online.com/MsgRef.html Look up #665.
MISRA2004 19.4 and 19.10 apply in some circumstances as well.
_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user