Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Toolchain attributes - use C++11/C11 #10837
Use standard C++11/C11 forms for
Using standard forms increases the chances that code analysis tools such Coverity will recognise them - particularly important for "no return".
Fix excess alignment problem caused by non-C++11
Pull request type
The `int : 0` bitfield this produced could force integer alignment onto the structure it was placed in, making a structure that should be 1 byte be 4 bytes. Change `int` to `bool` to minimise alignment impact - should be to nothing. Alignment/size problem was revealed in a `sizeof` check in an `Atomic<uint8_t>` test.
Newer language standards have standard forms for `MBED_NORETURN` and `MBED_ALIGN` attributes. Use them when available. C++14 also adds `[[deprecated]]`, but as it needs to go in the middle of structure definitions as `class [[deprecated]] MyClass`, it's not a total drop-in-replacemend for `MBED_DEPRECATED`, so that is not attempted here. Using standard forms increases the chances that code analysis tools such Coverity will recognise them - particularly important for "no return".