public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/45584]  New: typeof with casting from const to non-const does not work properly
@ 2010-09-07 16:52 radoslaw dot biernacki at gmail dot com
  2010-09-08  9:38 ` [Bug c/45584] " rguenth at gcc dot gnu dot org
  0 siblings, 1 reply; 4+ messages in thread
From: radoslaw dot biernacki at gmail dot com @ 2010-09-07 16:52 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 981 bytes --]

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


^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <bug-45584-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2014-08-19 17:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-07 16:52 [Bug c/45584] New: typeof with casting from const to non-const does not work properly radoslaw dot biernacki at gmail dot com
2010-09-08  9:38 ` [Bug c/45584] " rguenth at gcc dot gnu dot org
     [not found] <bug-45584-4@http.gcc.gnu.org/bugzilla/>
2014-08-19 14:15 ` ppalka at gcc dot gnu.org
2014-08-19 17:12 ` mpolacek at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).