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


On Jul 1, 2006, at 11:23 AM, Gary Funck wrote:
To further complicate matters, if the program is rewritten into a single
file as follows:


int __thread x;

int main() {
  extern int x;
  x = 5;
}

it will fail at compile-time with gcc 4.1:

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.


What are the technical reasons for the front-end enforcing this restriction,

None in the above case, just laziness probably.



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