Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #390099
| From | Ben Bacarisse <ben@bsb.me.uk> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Struct Error |
| Date | 2025-01-22 21:00 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <87sepa36nv.fsf@bsb.me.uk> (permalink) |
| References | <vmr5gg$137jo$1@dont-email.me> <20250122112439.579@kylheku.com> |
Kaz Kylheku <643-408-1753@kylheku.com> writes:
> On 2025-01-22, bart <bc@freeuk.com> 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)[];
>> };
>>
>> The error is:
>>
>> error: array type has incomplete element type 'struct scenet'
>> struct scenet (*child)[];
>> ^~~~~
>
> This looks like a bug to me. There is on reason why an
> incomplete array type (a pointer to which /is/ allowed!)
> should be constrained to have a complete element.
It may be a bug in the standard, but it's not a bug in the compiler:
6.7.6.2 Array declarators
Constraints
... The element type shall not be an incomplete or function type. ...
There is no dispensation that avoids this constraint when a pointer to
such an array is being declared (the constraint is on the array
declarator) nor when is type will be soon completed.
--
Ben.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar
Struct Error bart <bc@freeuk.com> - 2025-01-22 16:14 +0000
Re: Struct Error Kaz Kylheku <643-408-1753@kylheku.com> - 2025-01-22 20:05 +0000
Re: Struct Error Ben Bacarisse <ben@bsb.me.uk> - 2025-01-22 21:00 +0000
Re: Struct Error Richard Harnden <richard.nospam@gmail.invalid> - 2025-01-22 20:08 +0000
Re: Struct Error Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-22 22:27 +0000
Re: Struct Error James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-01-22 20:05 -0500
Re: Struct Error learningcpp1@gmail.com (m137) - 2025-01-23 03:49 +0000
Re: Struct Error Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-01-22 23:15 -0800
Re: Struct Error James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-01-23 03:37 -0500
Re: Struct Error Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-01-22 23:31 -0800
Re: Struct Error bart <bc@freeuk.com> - 2025-01-23 10:54 +0000
Re: Struct Error BGB <cr88192@gmail.com> - 2025-01-23 14:58 -0600
Re: Struct Error bart <bc@freeuk.com> - 2025-01-24 00:51 +0000
Re: Struct Error BGB <cr88192@gmail.com> - 2025-01-24 00:27 -0600
Re: Struct Error David Brown <david.brown@hesbynett.no> - 2025-01-24 09:45 +0100
Re: Struct Error Kaz Kylheku <643-408-1753@kylheku.com> - 2025-01-24 20:31 +0000
Re: Struct Error bart <bc@freeuk.com> - 2025-01-24 22:53 +0000
Re: Struct Error James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-01-24 20:53 -0500
Re: Struct Error James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-01-24 08:43 -0500
Re: Struct Error bart <bc@freeuk.com> - 2025-01-24 23:32 +0000
Re: Struct Error Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-23 23:50 +0000
Re: Struct Error bart <bc@freeuk.com> - 2025-01-24 00:37 +0000
Re: Struct Error Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-01-24 00:57 +0000
Re: Struct Error Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-01-23 17:23 -0800
Re: Struct Error bart <bc@freeuk.com> - 2025-01-24 01:27 +0000
Re: Struct Error James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-01-24 08:24 -0500
Re: Struct Error Michael S <already5chosen@yahoo.com> - 2025-01-24 16:37 +0200
Re: Struct Error bart <bc@freeuk.com> - 2025-01-26 19:14 +0000
Re: Struct Error Michael S <already5chosen@yahoo.com> - 2025-01-26 23:14 +0200
Re: Struct Error Kaz Kylheku <643-408-1753@kylheku.com> - 2025-01-27 04:05 +0000
Re: Struct Error bart <bc@freeuk.com> - 2025-01-27 20:19 +0000
Re: Struct Error Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-01-29 02:59 -0800
Re: Struct Error bart <bc@freeuk.com> - 2025-01-29 11:36 +0000
Re: Struct Error Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-01-30 11:51 -0800
Re: Struct Error Richard Damon <richard@damon-family.org> - 2025-01-29 07:32 -0500
Re: Struct Error Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-01-29 07:52 -0800
Re: Struct Error Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-01-22 23:11 -0800
Re: Struct Error Andrey Tarasevich <noone@noone.net> - 2025-02-02 20:35 -0800
csiph-web