gcc 4.1.2 is giving compilation error with unnamed structure with register const

View: New views
3 Messages — Rating Filter:   Alert me  

gcc 4.1.2 is giving compilation error with unnamed structure with register const

by Muralidhar :: Rate this Message:

| View Threaded | Show Only this Message

Hi All,
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â

$ gcc --version
gcc (GCC) 4.1.2 20070115 (SUSE Linux)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There
is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

$ gcc exam.c --> gcc 3.3 -> compilation success

$ gcc --version
gcc (GCC) 3.3.3 (SuSE Linux)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There
is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

Please help me ASAP.

-- Murali.

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

by Paolo Carlini-3 :: Rate this Message:

| View Threaded | Show Only this Message

Muralidhar wrote:
> Please help me ASAP.
>  
This problem has nothing to do with the C++ runtime library. I would
suggest gcc-help.

Paolo.

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

by Muralidhar :: Rate this Message:

| View Threaded | Show Only this Message

Thanks for information. Posted gcc-help.

Murali.
Paolo Carlini-3 wrote:
Muralidhar wrote:
> Please help me ASAP.
>  
This problem has nothing to do with the C++ runtime library. I would
suggest gcc-help.

Paolo.