This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/63643] pointer to const variable doesn't allow to change its value (on Mac OS)
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 25 Oct 2014 11:41:26 +0000
- Subject: [Bug c/63643] pointer to const variable doesn't allow to change its value (on Mac OS)
- Auto-submitted: auto-generated
- References: <bug-63643-4 at http dot gcc dot gnu dot org/bugzilla/>
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=]