Article View: net.bugs.v7
Article #69Re: overflow in C
From: utzoodecvaxharpoeaglemhtsaihnssi...
Date: Mon, 10 May 1982 17:08
Date: Mon, 10 May 1982 17:08
8 lines
834 bytes
834 bytes
I think the apparent overflow problem appears because of the way arguments are passed to printf(), not because the arithmetic is changing according to context. The 57000 or whatever will be interpreted as a long, not an int, on a PDP-11, and so the C compiler will push two words on the stack. Printf's arguments are misaligned, since it only expects one word there. The (A*B)/C value is never being printed at all in the last printf. (I forgot the values of A, B, C, 57000, but you know what I mean.)
Technical Details
Message-ID:
<bnews.minn-ua.173>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
From: utzoo!decvax!harpo!eagle!mhtsa!ihnss!ihps3!stolaf!minn-ua!slevy Newsgroups: net.bugs.v7 Title: Re: overflow in C Article-I.D.: minn-ua.173 Posted: Mon May 10 17:08:05 1982 Received: Wed May 12 03:31:31 1982 Subject: Re: overflow in C Date: Mon, 10 May 1982 17:08:05 +0000 Message-ID: <bnews.minn-ua.173>