This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/45584] New: typeof with casting from const to non-const does not work properly
- From: "radoslaw dot biernacki at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Sep 2010 16:52:03 -0000
- Subject: [Bug c/45584] New: typeof with casting from const to non-const does not work properly
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
typeof() does not property recognizes the non-const type, which was casted from
const type:
$ cat plik.c
#include <stdio.h>
int main()
{
const unsigned long val;
typeof( ((unsigned long)(val)) ) val2;
val2 = 0; //compilation error
}
$ gcc -o plik plik.c
plik.c: In function âmainâ:
plik.c:7: error: assignment of read-only variable âval2â
$ gcc --version
gcc (GCC) 4.4.3 20100127 (Red Hat 4.4.3-4)
...
--
Summary: typeof with casting from const to non-const does not
work properly
Product: gcc
Version: 4.4.3
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: radoslaw dot biernacki at gmail dot com
GCC build triplet: 4.4.3 20100127 (Red Hat 4.4.3-4)
GCC host triplet: Linux TVBuildAlfa 2.6.32.12-115.fc12.i686.PAE #1 SMP
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45584