Bug 155641 - Forward reference in extern array reference causes error.
Forward reference in extern array reference causes error.
Product: Fedora
Classification: Fedora
Component: gcc4 (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2005-04-22 01:08 EDT by Rusty Scott
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-04-24 07:24:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
A simple compile case to demonstrate the issue. (270 bytes, text/plain)
2005-04-22 01:08 EDT, Rusty Scott
no flags Details

  None (edit)
Description Rusty Scott 2005-04-22 01:08:36 EDT
Description of problem:
A valid forward reference to a structure in an external reference is errored by

Version-Release number of selected component (if applicable):
gcc version 4.0.0 20050405 (Red Hat 4.0.0-0.40)

How reproducible:

Steps to Reproduce:
1. get test_code.c (from attachment)
2. gcc test_code.c
Actual results:
test_code.c:7: error: array type has incomplete element type

Expected results:
This hasn't ever been an error before, I'm not aware of any specification
changes to the way forward references work.

Additional info:
Comment 1 Rusty Scott 2005-04-22 01:08:36 EDT
Created attachment 113510 [details]
A simple compile case to demonstrate the issue.
Comment 2 Jakub Jelinek 2005-04-24 07:24:22 EDT
This is not a bug.  Your testcase is not valid ISO C.  See ISO C99, Array
declarators: The element type shall not be an incomplete or function type.
Older GCC's issued a pedantic warning (resp. error with -pedantic-errors), in
GCC 4.0.x and later this error is unconditional.

Note You need to log in before you can comment on or make changes to this bug.