mkleemann / cmake-avr

cmake toolchain for AVR
Other
174 stars 61 forks source link

Binary extensions and -pedantic-errors #4

Closed bevice closed 9 years ago

bevice commented 9 years ago

With enabled add_definitions("-pedantic-errors") avr-gcc causes an error in code that contains binary extensions, for example:

value = 0b10101; 
mkleemann commented 9 years ago

I don't see this as an issue in the toolchain, since it's up to you to use it. This should be filed for the (AVR-)GCC instead.

Nevertheless, good to know this.

mkleemann commented 9 years ago

See http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Alternate-Keywords.html#Alternate-Keywords for a detailed explanation. Adding __extension__ before the binary expression should solve this (not tested yet).