public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/63643] New: pointer to const variable doesn't allow to change its value (on Mac OS)
@ 2014-10-25 11:41 romain.wallon at orange dot fr
  2014-10-25 11:47 ` [Bug c/63643] " dominiq at lps dot ens.fr
  2014-10-26  1:40 ` redi at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: romain.wallon at orange dot fr @ 2014-10-25 11:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63643

            Bug ID: 63643
           Summary: pointer to const variable doesn't allow to change its
                    value (on Mac OS)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: romain.wallon at orange dot fr

Created attachment 33806
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33806&action=edit
A program which tests changing a const value with a pointer.

For example, when a variable i is declared as const int, and p is declared as
int *, it is impossible to change the value of i by *p, whereas ANSI norm
allows it.
More over, it seems to be two differents value at the same address. Here is the
result of a test:

0x7fff5720dbf8 : 0
0x7fff5720dbf8 : 12

You'll find the program in attachment.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-26  1:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-25 11:41 [Bug c/63643] New: pointer to const variable doesn't allow to change its value (on Mac OS) romain.wallon at orange dot fr
2014-10-25 11:47 ` [Bug c/63643] " dominiq at lps dot ens.fr
2014-10-26  1:40 ` redi 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).