Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: Struct Error
Date: Wed, 22 Jan 2025 23:31:31 -0800
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <86y0z22dgs.fsf@linuxsc.com>
References:
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Thu, 23 Jan 2025 08:31:32 +0100 (CET)
Injection-Info: dont-email.me; posting-host="5251420bc9371d9685ddcd1ded05bea1";
logging-data="1611017"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/s4NSSXyzw5z44DocmULlzMixyVp/xmyY="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:VQzj5Vzck2Y+JW3TkR0icaX8lKY=
sha1:onCqfuhdzAQytVS8ZLoYdP1k5Jk=
Bytes: 2044
James Kuyper writes:
> On 2025-01-22, bart wrote:
>
>> Gcc 14.1 gives me an error compiling this code:
>>
>> struct vector;
>> struct scenet;
>>
>> struct vector {
>> double x;
>> double y;
>> double z;
>> };
>>
>> struct scenet {
>> struct vector center;
>> double radius;
>> struct scenet (*child)[];
>> };
>
> 6.7.6.2p2: "The element type shall not be an incomplete or function type."
>
> I have many draft versions of the C standard. n2912.pdf, dated
> 2022-06-08, says in 6.7.2.1.p3 about struct types that "... the type is
> incomplete144) until immediately after the closing brace of the list
> defining the content, and complete thereafter."
>
> Therefore, struct scenet is not a complete type until the closing brace
> of it's declaration.
>
> However, that sentence disappeared in n3047.pdf, dated 2022-08-04. Can
> anyone tell me why it was removed? [...]
That clause appears (slightly modified IIANM) in 6.7.2.3 p5.