[PATCH] D96853: [clang][AVR] Support variable decorator '__flash'

Ben Shi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 30 20:32:11 PDT 2021


benshi001 added a comment.

In D96853#2659266 <https://reviews.llvm.org/D96853#2659266>, @Anastasia wrote:

> Btw is any pointer conversion between address space 1 and the default address space allowed? I.e. is the following code valid:
>
>   __flash static const int var1[] = {111, 222, 333};
>   void foo(int*);
>   ....
>   foo(var1);
>
> or
>
>   __flash static const int var1[] = {111, 222, 333};
>   void foo(int*);
>   ....
>   foo((int*)var1);
>
> ?

No. clang denied with `error: passing 'const __attribute__((address_space(1))) int *' to parameter of type 'const int *' changes address space of pointer` while avr-gcc accepted it.

It seems I need more efforts to make clang-avr fully compatible with avr-gcc.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96853/new/

https://reviews.llvm.org/D96853



More information about the cfe-commits mailing list