Bug 155641

Summary: Forward reference in extern array reference causes error.
Product: [Fedora] Fedora Reporter: Rusty Scott <rustys>
Component: gcc4Assignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-04-24 11:24:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
A simple compile case to demonstrate the issue. none

Description Rusty Scott 2005-04-22 05:08:36 UTC
Description of problem:
A valid forward reference to a structure in an external reference is errored by
gcc4.

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

How reproducible:
always

Steps to Reproduce:
1. get test_code.c (from attachment)
2. gcc test_code.c
3.
  
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 05:08:36 UTC
Created attachment 113510 [details]
A simple compile case to demonstrate the issue.

Comment 2 Jakub Jelinek 2005-04-24 11:24:22 UTC
This is not a bug.  Your testcase is not valid ISO C.  See ISO C99, 6.7.5.2 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.