Re: void vs void* (philosophical question)



Chris Torek <nospam@xxxxxxxxx> writes:
In article <e82s8v$ho9$1@xxxxxxxxxxxxxxxxx>
Giannis Papadopoulos <ipapadop@xxxxxxxxxx> wrote:
According to the standard (ISO C99 draft WG14/N1124), void is the
incomplete type that cannot be completed and comprises the empty set of
values. Since it declares the absense of a value can it be considered a
data type?

In a larger, "not Standard C" sense, yes. In Standard C, however,
types are partitioned into "object types", "function types", and
"incomplete types". (The Standard does not define "data type" but
logically it would appear to map to "object type". Interestingly,
my C99 draft *uses* the phrase "data types" in the description of
<wchar.h>, in paragraph 1 of section 7.19.1. It is clear enough
that it does not mean "incomplete types" here. Perhaps the phrasing
was changed in the final standard, though.)

Are you sure about that section number? In both n869 and the final
standard, 7.19 is <stdio.h>; <wchar.h> is 7.24.

In the C99 standard, 7.19.1p1 says:

The header <stdio.h> declares three types, several macros, and
many functions for performing input and output.

and 7.24.1p1 says:

The header <wchar.h> declares four data types, one tag, four
macros, and many functions.

--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.



Relevant Pages

  • Re: void vs void* (philosophical question)
    ... incomplete type that cannot be completed and comprises the empty set of ... In a larger, "not Standard C" sense, yes. ... I might also remove the "flexible array member" and simply bless the ... Reading email is like searching for food in the garbage, ...
    (comp.lang.c)
  • Re: swprintf declaration inconsistencies?
    ... GCC declares that function as ... That definition is also present in references like:http://www.opengroup.org/pubs/online/7908799/xsh/swprintf.html ... swprintf was added in Amendment 1 circa 1995, the current standard ... implementations of swprintf already existed before ...
    (comp.lang.c)
  • Re: Linux
    ... >> int main ... Because it declares the operator<< needed to send ... almost all contemporary implementations do. ... the 8 standard stream objects (input, output, error, ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Can Class be Inter-refferenced?
    ... Someone who knows the C++ standard would have to check, ... is because when the function is called the size of ClassB must be known ... I think passing an incomplete type would only be a problem ... me as passing the object as a const & is generally preferred. ...
    (microsoft.public.vc.language)
  • Re: structure containing incomplete array type
    ... >> Is a structure containing an incomplete array as its last element (per ... >> incomplete type? ... Those words don't appear in the standard, although they do in draft ...
    (comp.lang.c)