This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/59850] Support sparse-style pointer address spaces (type attributes)
- From: "tromey at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 05 Feb 2014 14:44:58 +0000
- Subject: [Bug c/59850] Support sparse-style pointer address spaces (type attributes)
- Auto-submitted: auto-generated
- References: <bug-59850-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59850
--- Comment #6 from Tom Tromey <tromey at gcc dot gnu.org> ---
Null pointer constants are treated specially, which makes sense,
but only if they have type "void *" and are in address space 0.
That is, this works:
#define NULL ((__attribute__ ((address_space (0))) void *) 0)
__attribute__((address_space (1))) int *p = NULL;
But this gets a warning:
#define NULL ((__attribute__ ((address_space (1))) void *) 0)
__attribute__((address_space (0))) int *p = NULL;
And so does this:
#define NULL ((int *) 0)
__attribute__((address_space (1))) int *p = NULL;
I'm not sure whether that last one ought to be an error or not.