Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 155641 - Forward reference in extern array reference causes error.
Summary: Forward reference in extern array reference causes error.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc4
Version: 4
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-04-22 05:08 UTC by Rusty Scott
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-04-24 11:24:22 UTC


Attachments (Terms of Use)
A simple compile case to demonstrate the issue. (deleted)
2005-04-22 05:08 UTC, Rusty Scott
no flags Details

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.



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