[Top][All Lists]

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

Re: [avr-gcc-list] Inconsisten behaviour of switch statement

From: Preston Wilson
Subject: Re: [avr-gcc-list] Inconsisten behaviour of switch statement
Date: Mon, 26 Mar 2007 06:41:24 -0400
User-agent: Microsoft-Entourage/

"Schwichtenberg, Knut" <address@hidden> wrote:

> BTW: Is there any reason why the compares within the switch are at least 16
> bit and not type dependent for 8 bit types? If you program this as a normal
> if, 8 bit compares are generated.

The promotion of the controlling expression in the switch statement to an
integer is part of the C standard.  I cannot quote sections or lines of text
from the standard, but I know that is the spec'd behavior.

I don't know the answer to the first/real question.


reply via email to

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