[riot-notifications] [RIOT-OS/RIOT] core: Fix undefined behaviour in C11 atomics (#11528)

Marian Buschsieweke notifications at github.com
Wed May 15 14:35:50 CEST 2019


### Contribution description
Casting pointers to `volatile` memory to pointers to regular memory is permitted, but using those pointers to access the memory results in undefined behavior. This PR changes the casts to no longer drop the volatile qualifier.

References: https://en.cppreference.com/w/c/language/volatile

### Testing procedure
Compile some applications before and after this PR. The output should not differ.

### Issues/PRs references
https://github.com/RIOT-OS/RIOT/pull/11514

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

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

-- Commit Summary --

  * core: Fix undefined behaviour in C11 atomics

-- File Changes --

    M core/atomic_c11.c (44)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11528.patch
https://github.com/RIOT-OS/RIOT/pull/11528.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/11528
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190515/07ae9ac0/attachment.html>


More information about the notifications mailing list