Just to verify and cross-check my sanity, but is extern properly supported
yet?
If you're asking, I assume you hit a bug. What isn't working?
-Chris
[18:40] [asmodai@nexus] (1130) {139} % clang char.c
char.c:166:12: error: redefinition of 'groups'
char_group groups[MAX_GROUPS];
^
In file included from char.c:56:
./char.h:133:19: error: previous definition is here
extern char_group groups;
^
Additional information:
typedef struct {
char *name;
letter *defn;
} char_group;
For all I know this should be valid. At least icc and gcc don't complain about
it. And verifying with my standards and reference works I cannot see why it is
failing.
This is a bug or missing feature in the declaration merging code. Steve, can you take a look at this? Here's a self-contained example:
int array[10];
extern int array;
-Chris
If you’re asking, I assume you hit a bug. What isn’t working?
[18:40] [asmodai@nexus] (1130) {139} % clang char.c
char.c:166:12: error: redefinition of ‘groups’
char_group groups[MAX_GROUPS];
^
In file included from char.c:56:
./char.h:133:19: error: previous definition is here
extern char_group groups;
^This is a bug or missing feature in the declaration merging code.
Steve, can you take a look at this? Here’s a self-contained example:int array[10];
extern int array;
This is a missing feature that has a clear FIXME…
/// FIXME: Need to carefully consider tentative definition rules (C99 6.9.2p2).
/// For example, we incorrectly complain about i1, i4 from C99 6.9.2p4.
///
VarDecl *Sema::MergeVarDecl(VarDecl *New, Decl *OldD) {
MergeTypedefDecl and MergeFunctionDecl are also incomplete. They both have
TODO annotations…
snaroff
Yeah, sorry, still getting into the code base.
This is a missing feature that has a clear FIXME...
Yeah, sorry, still getting into the code base.
Understood (no problem).
Fixing the Sema::Merge* functions is on our TODO list (probably 2-3 days work to complete and cross reference with the spec).
Right now, I'm working on fixing the type checking issue you found. Should have a fix soon...
snaroff
Any of you guys happen to have looked at it in the mean time?
Nope, not yet
-Chris