This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/63643] pointer to const variable doesn't allow to change its value (on Mac OS)


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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2014-10-25
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
On x86_64-apple-darwin14 (Yosemite) I get

0x7fff58ce0414 : 12
0x7fff58ce0414 : 12

When compiling the test with -Wall -Wextra -pedantic I get

pr63643.c: In function 'main':
pr63643.c:7:9: warning: format '%p' expects argument of type 'void *', but
argument 2 has type 'const int *' [-Wformat=]
  printf("%p : %d\n", &i, i);
         ^
pr63643.c:7:9: warning: format '%p' expects argument of type 'void *', but
argument 2 has type 'const int *' [-Wformat=]
pr63643.c:8:9: warning: format '%p' expects argument of type 'void *', but
argument 2 has type 'int *' [-Wformat=]
  printf("%p : %d\n", p, *p);
         ^
pr63643.c:8:9: warning: format '%p' expects argument of type 'void *', but
argument 2 has type 'int *' [-Wformat=]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]