Re: gcc 4.1.2 is giving compilation error with unnamed structure of register const variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ian,

Thanks for looking into this issue. The issue can be avioded by either
removing const or register from the declaration. but unfortunately i
required the combination of both in my testing snerious.

Do we have any compiler option to avoid this bug.

-- Murali.
 

Ian Lance Taylor-3 wrote:
> 
> Muralidhar <muralidharvvkmca@xxxxxxxxx> writes:
> 
>> I have a sample program which is compiling fine in GCC version 3.3.3
>> on SUSE Linux  with kernel 2.6.5,
>> but it is giving compilation error in GCC version 4.1.2 with SUSE
>> Linux kernel 2.6.16
>>
>>  >>Sample program <<
>> $ cat exam.c
>> #include <stdio.h>
>> int main()
>> {
>>    register const struct           { short l; unsigned char d[2]; }
>> vVRCU___I = { 2,"a" };
>>    register const struct           { short l;          char d[2]; }
>> vVRC____I = { 2,"a" };
>>
>>    return 0;
>> }
>>
>> $ gcc exam.c --> gcc 4.1.2
>> exam.c: In function âmainâ:
>> exam.c:5: error: register name not specified for âvVRC____Iâ
>> exam.c:4: error: register name not specified for âvVRCU___Iâ
> 
> I think this is a bug.
> 
> To avoid the bug, remove the "register" keyword.  There is no reason to
> ever use the "register" keyword with current versions of gcc.
> 
> Ian
> 
> 

-- 
View this message in context: http://www.nabble.com/gcc-4.1.2-is-giving-compilation-error-with-unnamed-structure-of-register-const-variable-tp24647967p24654565.html
Sent from the gcc - Help mailing list archive at Nabble.com.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux