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

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

Re: [avr-gcc-list] AVR Libc int32_t and uint32_t typedefsareincorrect


From: Ruud Vlaming
Subject: Re: [avr-gcc-list] AVR Libc int32_t and uint32_t typedefsareincorrect
Date: Fri, 13 Jan 2012 14:45:08 +0000
User-agent: KMail/1.9.10

> > The problem i have with the standard C is that it lacks a
> > proper 8 bit arithmetic. That is why -mint8 comes in so 
> > handy, and produces very compact code. In many 
> > cases 8 bit are more  than enough to do the job, but within 
> > the standard you are enforced  to use a char (!) for numerical 
> > operations what in it self is already a strange situation. 
> > Of course it would be better to follow the standard 
> > to the letter. But if the standard does not allow for a 
> > much neaded feature AND a hack comes along which 
> > makes it possible anyway, than you will see that the bear 
> > is loose. 
> 
> I agree with you except for one point: I don't want to *have* 
> to do a hack (-mint8) to have the compiler do the right thing. 

Eh, did i say so? Well in any case: me too.

> I want the compiler to do the right thing in the code 
> generation without me having to specify anything!

Same here.  Note that, however, proper 8 bit arithmetic
is not 16 bit arithmetic without promotions when its
save. (Which could, theoretically, be left to the compiler,
if it were smart enough to find all optimizations.) And i must
agree, it became much smarter over time. -mint8 is of
much less now then a few years back)




reply via email to

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