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/59850] Support sparse-style pointer address spaces (type attributes)


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.


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