about named address space
Ian Lance Taylor
iant@google.com
Mon Jun 6 19:51:00 GMT 2011
Rony Paul <ronypaul77@gmail.com> writes:
> and in my program if I write code like,
> __ea int * p = malloc_ea(sizeof(int));
> int * v;
> p=v;
>
> this returns error message "assignment from pointer to non-enclosed
> address space"
> so, this checking for pointer of the different address space is done
> for pointer. now if I want to add this check for data variable also,
> what should I do. I cant understand, would you please help me?
>
> ie. I want to write code like
>
> extern int __ea x;
> int y;
>
> and it should give error message like
> "assignment from variable to non-enclosed address space"
I'm not aware of any support in current gcc for anything like that. In
effect you are asking not for named address spaces, but for a brand new
type. You want to permit pointers to your new type, but you don't want
to permit assignments between values of your new type and the old types.
I suspect that the most straightforward way to handle this would be to
do it entirely in the frontend, which is where types are handled. I
suppose you could tie it into named address spaces to the extent that
you want values of your new type to be aggregated into specific areas in
memory.
In short I don't know of any easy way to do what you want.
Ian
More information about the Gcc-help
mailing list