This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]