This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: externs and thread local storage
- From: "Gary Funck" <gary at intrepid dot com>
- To: "Gcc Mailing List" <gcc at gcc dot gnu dot org>
- Date: Sat, 1 Jul 2006 14:09:12 -0700
- Subject: RE: externs and thread local storage
Mike Stump wrote:
>
> This sounds like a bug that should be fixed. You should only need
> __thread on the extern if there was not a previous declaration for it.
>
The compiler seems pretty determined to enforce this restriction. Same
result
with 'const' instead of _thread:
int const x;
int main() {
extern int x;
x = 5;
}
t.c: In function 'main':
t.c:4: error: conflicting type qualifiers for 'x'
t.c:1: error: previous declaration of 'x' was here