🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3730

Re: 'sizeof e' vs. 'sizeof (T)' (was: Re: Parenthesis with return ?)

#3730
From: Paul Long
Date: Tue, 15 Aug 1995 16:39
27 lines
1375 bytes
Dan.Pop@mail.cern.ch (Dan Pop) wrote:
>In <40nqhd$1rs4@usenetp1.news.prodigy.com> NGMV85A@prodigy.com (Paul 
Long) writes:
>>clive@stdc.demon.co.uk (Clive D.W. Feather) wrote:
>>>In article <3415076830.8283127@ortel.org>,
>>>Paul Long <Paul_Long@ortel.org> wrote:
>>>> If [...] the following would all yield 1:
>>>>   sizeof(char)
>>>>   sizeof(int)
>>>>   sizeof c
>>>>   sizeof c + 1
>>>
>>>The last of these can never be 1 (assuming it occurs in a strictly
>>>conforming program).
[snip]
>> Why do you think 
>>"sizeof c + 1" can never be 1 in a conforming program?
>
>Because the sizeof operator has a higher precedence than the binary +
>operator :-)
>
>I hope that your compilers parse that expression better than you did
>yourself :-)

Yeah, it just dawned on me in the shower. Sorry.

Paul Long
Technical Details
Message-ID: <40qiji$485i@usenetp1.news.prodigy.com>
Path: arc1-ca.pugleaf.net!prodigy.com!usenet
References: <3415076830.8283127@ortel.org> <dd9uho.ajm@stdc.demon.co.uk> <40nqhd$1rs4@usenetp1.news.prodigy.com> <danpop.808417015@rscernix>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!prodigy.com!usenet
From: NGMV85A@prodigy.com (Paul Long)
Newsgroups: comp.std.c
Subject: Re: 'sizeof e' vs. 'sizeof (T)' (was: Re: Parenthesis with return ?)
Date: 15 Aug 1995 16:39:14 GMT
Organization: Prodigy Services Company  1-800-PRODIGY
Distribution: world
Message-ID: <40qiji$485i@usenetp1.news.prodigy.com>
References: <3415076830.8283127@ortel.org> <dd9uho.ajm@stdc.demon.co.uk> <40nqhd$1rs4@usenetp1.news.prodigy.com> <danpop.808417015@rscernix>
NNTP-Posting-Host: inugap3.news.prodigy.com
X-Newsreader: Version 1.2