Article View: comp.lang.modula2
Article #2614Re: Report on defect in M2 vs C (Was Modula-2, Modula-3, C or C++)
From: Mike McCarty
Date: Wed, 11 Oct 1995 23:15
Date: Wed, 11 Oct 1995 23:15
34 lines
2070 bytes
2070 bytes
In article <813106607.29468@skipper.demon.co.uk>,
Neil Tungate <neil@skipper.demon.co.uk> wrote:
)seh@seh.codem.com (Stephen E. Halpin) wrote:
)
)>Something is better than nothing, as long as you dont get a false sense
)>of security from it. Im more concerned about boundary behavior, ie what
)>happens with (2^31)*4/32.. When executed in order, it should really
)>produce an exception - veriants of C which dont optimize to (2^31)/8
)>return 0 and go on their merry way... The simple truth of the matter
)>is you have to know something about the underlying machine in almost any
)>language.
)
)As a naturally cautious type when programming, I would have written:
)
)(2^31)*(4/32)
)
)as a matter of course. This style makes equations easier to read, and
)also helps the compiler. ie I am forcing the order of execution at all
)times and can therefore ignore compiler nuances :-)
I read this carefully to make sure that we were really talking about C.
It seems strange to combine exclusive or with multiply and divide. The
result should, of course, be 0, and most compilers will simply put the
constant in that way.
But to the point: you are =not= forcing order of execution of anything.
Parentheses have no effect on order of execution. There may not, in
fact, be any "execution".
Mike
----
char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
I don't speak for DSC. <- They make me say that.
Technical Details
Message-ID:
<45hj7a$36@sun001.spd.dsccc.com>Path:
arc1-ca.pugleaf.net!sun001.spd.dsccc.com!spd!jmccartyReferences:
<Pine.SUN.3.91.951005003000.1000A-100000-100000-100000@lagrange.uwaterloo.ca> <4540ha$hqn@regina.seh.codem.com> <813106607.29468@skipper.demon.co.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sun001.spd.dsccc.com!spd!jmccarty From: jmccarty@spd.dsccc.com (Mike McCarty) Newsgroups: comp.lang.modula2,comp.lang.modula3,comp.lang.c,comp.lang.c++,comp.lang.ada Subject: Re: Report on defect in M2 vs C (Was Modula-2, Modula-3, C or C++) Date: 11 Oct 1995 23:15:54 GMT Organization: DSC Communications Corporation, Plano, Texas USA Message-ID: <45hj7a$36@sun001.spd.dsccc.com> References: <Pine.SUN.3.91.951005003000.1000A-100000-100000-100000@lagrange.uwaterloo.ca> <4540ha$hqn@regina.seh.codem.com> <813106607.29468@skipper.demon.co.uk> NNTP-Posting-Host: aplo139.spd.dsccc.com