This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/16699] New: assembler compares integers when char are supposed to be used


#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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]