From: Dan.Pop@cern.ch (Dan Pop)
Subject: Re: Bug in OSF1.32 C compiler on alpha
Date: 1996/07/08 [thread overview]
Message-ID: <danpop.836846769@news.cern.ch> (raw)
In-Reply-To: 4rq5ud$qe3@vixen.cso.uiuc.edu
In <4rq5ud$qe3@vixen.cso.uiuc.edu> peltz@jaka.ece.uiuc.edu (Steve Peltz) writes:
>In article <danpop.836336015@news.cern.ch>, Dan Pop <Dan.Pop@cern.ch> wrote:
>>In <4r9jsg$p3h@vixen.cso.uiuc.edu> peltz@jaka.ece.uiuc.edu (Steve Peltz) writes:
>>> printf("%d %d %d\n", sizeof x, sizeof(float), sizeof(double));
>>>
>>>It shows 8 4 8.
>>
>>Which may or may not have any meaning, because your call invokes
>>undefined behaviour. %d expects an int argument, but the sizeof operator
>>_never_ produces an int value.
>
>Since we were talking about a specific compiler on a specific machine, it
>seemed unnecessary to specify any excess luggage to demonstrate the point.
>In fact, sizeof results in unsigned long in this case.
And %d expects int, a type of a different size. If the output looked
meaningful at all it is because of an implementation quirk (32-bit int's
are widened to 64 bits when passed as arguments).
But my point was that you can't use broken code to prove anything
(other than your poor understanding of the language :-)
Dan
--
Dan Pop
CERN, CN Division
Email: Dan.Pop@cern.ch
Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
next prev parent reply other threads:[~1996-07-08 4:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-07-01 4:00 Bug in OSF1.32 C compiler on alpha Nigel Goddard
1996-07-01 4:00 ` Daryl Clevenger
1996-07-01 4:00 ` Steve Peltz
1996-07-02 4:00 ` Dan Pop
1996-07-08 4:00 ` Steve Peltz
1996-07-08 4:00 ` Dan Pop [this message]
1996-07-02 4:00 ` Dan Pop
1996-07-03 4:00 ` Andy V
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox