[Top][All Lists]

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

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

From: Ruud Vlaming
Subject: Re: [avr-gcc-list] AVR Libc int32_t and uint32_t typedefs areincorrect
Date: Fri, 13 Jan 2012 13:37:46 +0000
User-agent: KMail/1.9.10

On Thursday 12 January 2012, Weddington, Eric wrote:
> The problem that I have with -mint8 is:
> - it doesn't follow the standard
> - it breaks avr-libc (or rather, avr-libc isn't adapted to it)
> - people use it, because the backend hasn't been taught how to do the
> right thing.
> The thing is, is if the AVR backend knew how to optimize away these
> superfluous promotions, then I really don't think that -mint8 would ever
> really be needed. Why should a user have to specify a switch to get the
> compiler to do the right thing?

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. (BTW you see this all the time,
in any standard, until the standard evolves so i can satisfy its users

Personally i do use -mint8 alot without any problems and if
an avr-libc feature is needed (which for me is not so often), 
i have quick look through the code to see if anything strange 
might be expected. I cannot remember that i have encountered

reply via email to

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