🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #955

Re: sizeof ((rehash *) 0)->again

#955
From: Doug Gwyn
Date: Fri, 17 Nov 1989 16:11
11 lines
977 bytes
In article <11138@riks.csl.sony.co.jp> diamond@ws.sony.junet (Norman Diamond) writes:
>Section 3.3.4 says that the result has the named type, i.e. rehash *.
>Therefore the semantics of -> select a member of the pointed-to type,
>and sizeof takes its size.

This argument was already made and I disagreed before too.
My argument is that a null pointer does not point to anything.
The only open issue I know of here is whether a compiler is
obliged to accept this construct, obliged to diagnose it, or
free to randomly decide what to do about it.  I wouldn't
recommend its use in portable programs.
Technical Details
Message-ID: <11628@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!aplcen!haven!adm!smoke!gwyn
References: <11138@riks.csl.sony.co.jp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!aplcen!haven!adm!smoke!gwyn
From: gwyn@smoke.BRL.MIL (Doug Gwyn)
Newsgroups: comp.std.c
Subject: Re: sizeof ((rehash *) 0)->again
Message-ID: <11628@smoke.BRL.MIL>
Date: 17 Nov 89 16:11:03 GMT
References: <11138@riks.csl.sony.co.jp>
Reply-To: gwyn@brl.arpa (Doug Gwyn)
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 11