On 07/06/11 19:27, Celio Guimaraes wrote:
uint32_t  t1;
int main(){
     t1=0xf << (12);    // t1 gets fffff000 instead of 0000f000
}


Others have pointed out your mistake, and given clear explanations.

For the future, please don't make claims about bugs in avr-gcc unless you are entirely sure that it /is/ a bug - and even then, pose your post as a question (is this a bug?). The guys who write gcc and the avr-gcc port are very smart, very experienced, and very conscientious about programming and testing. They are not infallible, and bugs do turn up occasionally - but in the great majority of cases, the bug lies in the user's code (or their understanding of C), rather than the compiler.

It is also polite to add a bit more text to your post (as well as the code, which was nice) - you are asking unpaid volunteers to help you. Don't worry if English is not your first language (guessing by your name) - no one will mind any mistakes.

mvh.,

David


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to