[Bug c/16699] New: assembler compares integers when char are supposed to be used
spiessensr at woodlandsnet dot co dot za
gcc-bugzilla@gcc.gnu.org
Sat Jul 24 18:59:00 GMT 2004
#define acin PB1 // 0=input
#define PORTB_DDR 0x04
typedef unsigned char u08;
int main( void )
{
u08 k;
DDRB=PORTB_DDR;
// 1. this comparison results in undesired int operations
while ((PINB&_BV(acin))==0);
// 2. even when you typecast it
while ((unsigned char)(PINB&_BV(acin))==(unsigned char)0);
// 3. this works I expected no. 1 to work (??)
k=0;
while ((PINB&_BV(acin))==k);
}
--
Summary: assembler compares integers when char are supposed to be
used
Product: gcc
Version: 3.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: spiessensr at woodlandsnet dot co dot za
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16699
More information about the Gcc-bugs
mailing list