[prev in list] [next in list] [prev in thread] [next in thread]
List: cfe-dev
Subject: [cfe-dev] [cfe-commits] r41592 - in /cfe/trunk:
From: clattner () apple ! com (Chris Lattner)
Date: 2007-08-30 21:20:45
Message-ID: C3E86555-E05C-4629-AB54-5F3D2D2CAAB5 () apple ! com
[Download RAW message or body]
On Aug 30, 2007, at 1:22 PM, Keith Bauer wrote:
>> Which missing extern? This might be a clang bug still,
>
> Hmm, GCC's pretty insistent on accepting it:
>
> imac:Desktop keith$ cat missing_extern.c
> struct foo { int x; };
> struct foo f;
> struct foo f = { 3 };
> imac:Desktop keith$ gcc -fsyntax-only -Wall -Wextra missing_extern.c
> imac:Desktop keith$ clang -fsyntax-only missing_extern.c
> missing_extern.c:3:12: error: redefinition of 'f'
> struct foo f = { 3 };
> ^
> missing_extern.c:2:12: error: previous definition is here
> struct foo f;
> ^
> 2 diagnostics generated.
>
> OTOH, the only reason it was working for me was that only one source
> file included the header that was missing the extern... so whether
> it's a clang bug or not, it was my bug too ;)
Yep, this is a clang bug. "struct foo f" should have common linkage,
and be merged with the later full definition. C is a great
language ;-). GCC should reject this with -fno-common.
-Chris
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic