Deutsch   English   Français   Italiano  
<vmr5gg$137jo$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Struct Error
Date: Wed, 22 Jan 2025 16:14:08 +0000
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <vmr5gg$137jo$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 22 Jan 2025 17:14:08 +0100 (CET)
Injection-Info: dont-email.me; posting-host="213f294ee773b84f9e92c071198931bc";
	logging-data="1154680"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1++2wJjnH6rwBRH0gX0gxz1"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:OUEc/W2DH0EKUDdkzw73VySjFxU=
Content-Language: en-GB
Bytes: 1588

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)[];
   };

The error is:

   error: array type has incomplete element type 'struct scenet'
    struct scenet (*child)[];
                   ^~~~~

Is there any way to fix this, or is it not possible?

(This comes from generated code. Idiomatic C would use a T* here rather 
than T(*)[], but that is not an option. Other compilers like tcc, DMC 
and mine have no problem with it.)