🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4364

"Size not needed?"

#4364
From: Paul Long
Date: Fri, 17 Nov 1995 03:02
26 lines
1501 bytes
Section 6.5.2.3 says, "If a type specifier of the form _struct-or-union
identifier_ occurs prior to the declaration that defines the content, the
structure or union is an incomplete type. It declares a tag that specifies a
type that may be used only when the size of an object of the specified type is
not needed."

What does "the size...is not needed" mean? "Needed" sounds awfully vague. For
example, is the size needed here?

   struct S x;
   void foo() { x; }

I don't think so, but perhaps this is implementation-dependent.

How about this one:

   void bar(struct T x) { x; }

Is this a conforming program? Is a diagnostic required?

-- 
Paul Long         plong@perf.com       http://www.teleport.com/~pciwww/
  "A perfect method should not only be an efficient one, as respects
  the accomplishment of the objects for which it is designed, but
  should in all its parts and processes manifest a certain unity and
  harmony." - George Boole, _An Investigation of the Laws of Thought_
Technical Details
Message-ID: <48gu0r$91o@news0.rain.rg.net>
Path: arc1-ca.pugleaf.net!newsfeed.internetmci.com!psgrain!rainrgnews0!usenet

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!newsfeed.internetmci.com!psgrain!rainrgnews0!usenet
From: Paul Long <plong@perf.com>
Newsgroups: comp.std.c
Subject: "Size not needed?"
Date: 17 Nov 1995 03:02:51 GMT
Organization: Performance Computing Incorporated
Message-ID: <48gu0r$91o@news0.rain.rg.net>
NNTP-Posting-Host: yosemite.perf.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.1 sun4c)
X-URL: news:comp.std.c