Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: No, C is not a simple language
Date: Mon, 19 Apr 2021 04:20:20 -0700
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <86h7k2h66j.fsf@linuxsc.com>
References: <878s5f1im9.fsf@nosuchdomain.example.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="06b334b85b44a22c3ab1a4f53205352f"; logging-data="5792"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Qpu09/dTqNAva8QiHAdoGOqa2jajOlrM="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:utHACJg9gD//dSK05PsGYHyRPQM= sha1:DFpLpBlF9xlIWEB0h7dMZ1XVAOc=
Xref: csiph.com comp.lang.c:160219
Keith Thompson writes:
> Manfred writes:
>> [...]
[discussion of opaque types using pointers to structs whose contents
are not defined]
>> This is nothing new, as I wrote the entire FILE* infrastructure
>> works this way.
>
> Except that you *can* assign objects of type FILE (if you don't
> mind undefined behavior). The FILE type is opaque in the sense
> that the standard doesn't say what it looks like, but it has to be
> an object type.
It should be noted that the term "object type" acquired a new
meaning in C11. Before C11, the C standard divides types into
function types, object types, and incomplete types, so "object
type" always meant a complete type and not an incomplete type.
Starting in C11, the C standard divides types into function types
and object types, with object types further divided into complete
object types and incomplete object types. So although it is true
that FILE is an object type, starting in C11 that doesn't mean it
is necessarily a complete object type.