[Bug c/59850] Support sparse-style pointer address spaces (type attributes)
tromey at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Feb 21 03:09:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59850
--- Comment #17 from Tom Tromey <tromey at gcc dot gnu.org> ---
It seems that "force" works on function parameters and casts
but not direct assignments:
bapiya. nl -ba /tmp/q.c
1 #define A(N) __attribute__((address_space (N)))
2 #define force __attribute__((force))
3
4 force int *ok;
5 A(1) int *nope;
6
7 void g(force int *p)
8 {
9 ok = p;
10 }
11
12 void f(void)
13 {
14 g(nope);
15 ok = nope;
16 }
bapiya. ./sparse -Wno-decl -Waddress-space /tmp/q.c
/tmp/q.c:15:6: warning: incorrect type in assignment (different address spaces)
/tmp/q.c:15:6: expected int *[addressable] [toplevel] [assigned] ok
/tmp/q.c:15:6: got int <asn:1>*[addressable] [toplevel] nope
(This is using git master sparse from today)
More information about the Gcc-bugs
mailing list