insane-adding-machines / unicore-mx

UniCore-MX | Universal Core for ARM Cortex-M0/0+/3/4/7/X
GNU General Public License v3.0
50 stars 8 forks source link

RFC: Follow C Standard #46

Closed kuldeepdhaka closed 7 years ago

kuldeepdhaka commented 7 years ago

Current code has some GCC specific portion. Should we make changes to our code that is valid as per C standard?

Example:

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.

ChuckM commented 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.