[cfe-dev] address_space pragma

David Chisnall via cfe-dev cfe-dev at lists.llvm.org
Thu Aug 2 10:05:41 PDT 2018


On 1 Aug 2018, at 20:19, Leonard Chan via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> 
> ```
> error: passing '__attribute__((address_space(2))) char *' to parameter
> of type '__attribute__((address_space(1))) char *' changes address
> space of pointer
> ```
> 
> We would like to propose a pragma that would allow for binding an
> address_space to a string, and a list of other attributes used with
> address_space, such that the error will instead print the string
> passed instead of the whole attribute. That is, this would be dumped
> instead:
> 
> ```
> error: passing 'SPACE2 char *' to parameter of type 'SPACE1 char *'
> changes address space of pointer
> ```

A few other error messages look for macro definitions and, if there is a macro that expands to the correct character sequence, use that macro name instead in the error message.  Is there a reason that the same approach wouldn’t work here?

David




More information about the cfe-dev mailing list