mpz_import/mpz_export and syntax errors

DTAshley@aol.com DTAshley@aol.com
Fri, 2 May 2003 20:03:44 EDT


--part1_1dd.8dbc6aa.2be46160_boundary
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

Actually, there is more bad than just the semicolon.

It is traditional to make preprocessor constants all upper-case so that it is 
clear they are not variables.

Additionally, it is traditional and recommended by many coding standards to 
parenthesize all such constants, i.e.

#define WORD_BYTES  (4)

because if you don't there are some scenarios in which the preprocessor 
substitution could combine the "4" with other digits or other symbols.

Best regards, Dave.

In a message dated 5/2/2003 7:24:22 PM Eastern Daylight Time, 
evantd@u.washington.edu writes:

> Oh for crying out loud! I actually had:
> #define word_bytes 4; <-- note BAD semicolon!
> It would turn out to be something that stupid wouldn't it?
> Anyway, thanks a whole lot for the advice. It's been a while since I
> used C. I guess I'll have to remember to check for that kind of thing
> from now on.
> Thanks again,
> Evan
> 


--part1_1dd.8dbc6aa.2be46160_boundary
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<HTML><FONT FACE=3Darial,helvetica><FONT  SIZE=3D2 FAMILY=3D"SANSSERIF" FACE=
=3D"Arial" LANG=3D"0">Actually, there is more bad than just the semicolon.<B=
R>
<BR>
It is traditional to make preprocessor constants all upper-case so that it i=
s clear they are not variables.<BR>
<BR>
Additionally, it is traditional and recommended by many coding standards to=20=
parenthesize all such constants, i.e.<BR>
<BR>
#define WORD_BYTES&nbsp; (4)<BR>
<BR>
because if you don't there are some scenarios in which the preprocessor subs=
titution could combine the "4" with other digits or other symbols.<BR>
<BR>
Best regards, Dave.<BR>
<BR>
In a message dated 5/2/2003 7:24:22 PM Eastern Daylight Time, evantd@u.washi=
ngton.edu writes:<BR>
<BR>
<BLOCKQUOTE TYPE=3DCITE style=3D"BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT=
: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">Oh for crying out loud! I actua=
lly had:<BR>
#define word_bytes 4; &lt;-- note BAD semicolon!<BR>
It would turn out to be something that stupid wouldn't it?<BR>
Anyway, thanks a whole lot for the advice. It's been a while since I<BR>
used C. I guess I'll have to remember to check for that kind of thing<BR>
from now on.<BR>
Thanks again,<BR>
Evan<BR>
</BLOCKQUOTE><BR>
<BR>
</FONT></HTML>
--part1_1dd.8dbc6aa.2be46160_boundary--