avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Bug in shift operation with avr-gcc


From: David Brown
Subject: Re: [avr-gcc-list] Bug in shift operation with avr-gcc
Date: Tue, 07 Jun 2011 21:46:28 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]