Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c > #362

Re: Types in C

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.std.c, comp.lang.c
Subject Re: Types in C
Date 2011-05-31 08:47 -0700
Organization None to speak of
Message-ID <ln62oqrhwf.fsf@nuthaus.mib.org> (permalink)
References <irbo6c$ul$1@speranza.aioe.org> <is0vfg$vqg$1@dont-email.me> <is136f$pdt$1@dont-email.me>

Cross-posted to 2 groups.

Show all headers | View raw


Shao Miller <sha0.miller@gmail.com> writes:
> On 5/30/2011 3:42 PM, Marcin Grzegorczyk wrote:
>> jacob navia wrote:
>>> [...]
>>> A C type can be either a function type, an incomplete type or an object
>>> type.
>>
>> Recently the Committee agreed with Clive Feather that completeness is a
>> scoped property of object types (there are no incomplete function types,
>> after all), and the latest C1X draft says the following under 6.2.5
>> ("Types"):
>>
>> # Types are partitioned into object types (types that describe objects)
>> # and function types (types that describe functions). At various points
>> # within a translation unit an object type may be incomplete (lacking
>> # sufficient information to determine the size of objects of that type)
>> # or complete (having sufficient information).
>>
>> I, too, believe it is a clearer way of describing how the C type system
>> works. (For Clive's rationale, see the WG14 document N1439).
>
> Though I think the obsolescence under the N1494's 6.11.6p1 is 
> intuitively akin to an "incomplete function type," though such a term is 
> not defined in a standard sense, perhaps.

    For those who don't have a copy of N1494:

    6.11.6 Function declarators

    The use of function declarators with empty parentheses (not
    prototype-format parameter type declarators) is an obsolescent
    feature.

I don't see much resemblance between that and incomplete type.
The obsolecence itself is irrelevant; until they're removed from
the language (and when is the committee finally going to get around
to that?), they're a required language feature.

A function type declared without a prototype is fully usable; you can
declare a pointer to it and use such a pointer in a function call.
I suppose it's "incomplete" in the sense that some information is
missing, but it's not the same kind of incompleteness that applies
to void.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.std.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Types in C jacob navia <jacob@spamsink.net> - 2011-05-22 21:29 +0200
  Re: Types in C Keith Thompson <kst-u@mib.org> - 2011-05-22 12:48 -0700
  Re: Types in C Marcin Grzegorczyk <mgrzegor@poczta.onet.pl> - 2011-05-30 22:42 +0200
    Re: Types in C Shao Miller <sha0.miller@gmail.com> - 2011-05-30 17:45 -0500
      Re: Types in C Keith Thompson <kst-u@mib.org> - 2011-05-31 08:47 -0700
        Re: Types in C Shao Miller <sha0.miller@gmail.com> - 2011-05-31 13:54 -0400
      Re: Types in C Tim Rentsch <txr@alumni.caltech.edu> - 2011-05-31 22:38 -0700
        Re: Types in C Shao Miller <sha0.miller@gmail.com> - 2011-06-01 07:22 -0500
          Re: Types in C Tim Rentsch <txr@alumni.caltech.edu> - 2011-06-01 12:13 -0700
    Re: Types in C jacob navia <jacob@spamsink.net> - 2011-05-31 00:16 +0200
      Re: Types in C Shao Miller <sha0.miller@gmail.com> - 2011-05-30 18:30 -0500
        Re: Types in C Tim Rentsch <txr@alumni.caltech.edu> - 2011-05-31 22:43 -0700
          Re: Types in C Shao Miller <sha0.miller@gmail.com> - 2011-06-01 07:41 -0500
            Re: Types in C Tim Rentsch <txr@alumni.caltech.edu> - 2011-06-01 12:23 -0700
      Re: Types in C Marcin Grzegorczyk <mgrzegor@poczta.onet.pl> - 2011-06-02 22:44 +0200
        Re: Types in C jacob navia <jacob@spamsink.net> - 2011-06-02 22:49 +0200
          Re: Types in C Keith Thompson <kst-u@mib.org> - 2011-06-02 15:26 -0700

csiph-web