[riot-notifications] [RIOT-OS/RIOT] core: fix c11 atomic definitions (fix gcc9 compilation) (#11514)

Kaspar Schleiser notifications at github.com
Mon May 13 13:26:20 CEST 2019


### Contribution description

gcc 9 broke the compilation of our c11 atomics on ARM.

Basically, where the operations previously took ```uint[8, 16, 32]_t *``` pointers as arguments, they are now expected to get ```void *````pointers.

Furthermore, the return type for "int" sized atomic builtins is expected to be ```unsigned int``` instead of the stdint type.

For core/atomic_sync.c, a commit adds a guard to only compile if gcc < 4.7, which solves the problem altogether.

For core/atomic_c11.c, the arguments are fixed accordingly. The return type is fixed by making the respective typedefs depend on ```__SIZEOF_INT__```.

I've piggybacked another commit fixing the type of an ```uint8_t[1] + large value``` on Cortex-M.

### Testing procedure

Compile with gcc 9 (e.g., on current Arch linux). Compile with older compilers. Run tests to see if anything breaks.

### Issues/PRs references


You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/11514

-- Commit Summary --

  * core/atomic_sync: guard by GCC >= 4.7
  * core/atomic_c11: fix declarations
  * cpu/cortexm: fix pointer calculation

-- File Changes --

    M core/atomic_c11.c (47)
    M core/atomic_sync.c (12)
    M cpu/cortexm_common/vectors_cortexm.c (2)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11514.patch
https://github.com/RIOT-OS/RIOT/pull/11514.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11514
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190513/0a258b33/attachment.html>


More information about the notifications mailing list