🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2537

Re: offsetof

#2537
From: Doug Gwyn
Date: Sun, 10 Mar 1991 19:57
12 lines
959 bytes
In article <1991Mar6.232854.22267@athena.mit.edu> jfc@athena.mit.edu (John F Carr) writes:
>Is the following legal C?
>	struct foo { struct bar { int a;} b;};
>	offsetof(struct foo, a.b);
>Section 4.1.5 of the standard doesn't explicitly disallow this, but I wasn't
>able to find definitions elsewhere that would tell me if "a.b" is a
>structure member or not.

(1)  You mean "b.a", not "a.b".
(2)  You mean "designates", not "is".
(3)  The wording in the description of offsetof() was carefully chosen
to permit "dotted" member designators such as you attempted to use.
Technical Details
Message-ID: <15411@smoke.brl.mil>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!hsdndev!cmcl2!adm!smoke!gwyn
References: <1991Mar6.232854.22267@athena.mit.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!hsdndev!cmcl2!adm!smoke!gwyn
From: gwyn@smoke.brl.mil (Doug Gwyn)
Newsgroups: comp.std.c
Subject: Re: offsetof
Message-ID: <15411@smoke.brl.mil>
Date: 10 Mar 91 19:57:14 GMT
References: <1991Mar6.232854.22267@athena.mit.edu>
Organization: U.S. Army Ballistic Research Laboratory, APG, MD.
Lines: 12