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.

Reply via email to