Article View: comp.std.c
Article #33Re: arrays of incomplete type elements
From: Larry Jones
Date: Thu, 29 Oct 1992 16:48
Date: Thu, 29 Oct 1992 16:48
23 lines
1532 bytes
1532 bytes
In article <1992Oct28.184633.8363@netcom.com>, rfg@netcom.com (Ronald F. Guilmette) writes: > I assume that this also implies that the following declarations are invalid > (according to ANSI C): > > typedef int two_d_type[][]; > extern int two_d_object[][]; > > Now the *real* question is "Are standard conforming implementations required > to issue diagnostics for these declarations, and for the declaration of > the type `table' in my original example?" No. Conforming implementation are only required to diagnose syntax errors and constraint violations. Declaring an array of incomplete type is neither, so it produces undefined behavior. An implementation is free to accept it and do the right thing (like most do with the previous typedef example), produce an error message and refuse to generate code (like most do with the above example), or anything else they like (such as turning into a butterfly and flying away, as one well-known hypothetical implementation does). ---- Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH 45150-2789 513-576-2070 larry.jones@sdrc.com or ...uunet!sdrc!larry.jones Oh, now don't YOU start on me. -- Calvin
Technical Details
Message-ID:
<2188@sdrc.COM>Path:
arc1-ca.pugleaf.net!sparky!uunet!sdrc!thor!scjonesReferences:
<1992Oct27.080515.9088@netcom.com> <2175@sdrc.COM> <1992Oct28.184633.8363@netcom.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!sdrc!thor!scjones From: scjones@thor.sdrc.com (Larry Jones) Newsgroups: comp.std.c Subject: Re: arrays of incomplete type elements Message-ID: <2188@sdrc.COM> Date: 29 Oct 92 16:48:16 GMT References: <1992Oct27.080515.9088@netcom.com> <2175@sdrc.COM> <1992Oct28.184633.8363@netcom.com> Sender: news@sdrc.COM Lines: 23