Closed kuldeepdhaka closed 7 years ago
Generally it makes a lot of sense to follow the C standard and it will make it easier to add support for things like clang in the future. You can turn off gcc features with -std=
in the makefile. I'm a fan of C99 but I know that a lot of people like to mix things like C++ comments with // which C99 doesn't allow.
That said, since you're using ARM's toolchain you can just follow what they do.
Current code has some GCC specific portion. Should we make changes to our code that is valid as per C standard?
Example:
Arithmetic operation on void pointer is not valid in C Standard
C Standard has no binary notation (
0b
)__attribute((packed)) and __attribute((aligned(<...>)) is GCC specific. Note:
#pragma
are available but are also implementation specific.If we choose, C standard, In future, we have to make sure that all code in our C codebase should be valid as per C standard (and dont use any implementation specific features).
Edit: Added __attribute__ example.