This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/16699] New: assembler compares integers when char are supposed to be used
- From: "spiessensr at woodlandsnet dot co dot za" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jul 2004 18:59:07 -0000
- Subject: [Bug c/16699] New: assembler compares integers when char are supposed to be used
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
#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