Anatoly Sokolov schrieb:
Hi.
Consider this test case:
unsigned long rotl (int dummy, unsigned long x)
{
return (x 8) | (x 24);
}
Compile with, e.g.
avr-gcc -mmcu=atmega8 -S -Os -fno-split-wide-types
This will map 0x33221100 to 0x33110033 instead of to 0x22110033
Please test the
-Original Message-
From:
avr-gcc-list-bounces+eric.weddington=atmel@nongnu.org
[mailto:avr-gcc-list-bounces+eric.weddington=atmel@nongnu.
org] On Behalf Of Bob Paddock
Sent: Wednesday, March 25, 2009 2:08 PM
To: Gene Smith
Cc: avr-gcc-list@nongnu.org
Subject: Re:
From: david.br...@hesbynett.no
[...char vs. signed cahr vs. unsigned char...]
Don't look it up - if you learn the compiler's default behaviour, you
risk writing incorrect code. If it is in any way relevant whether a
char is signed or not, write signed char or unsigned char explicitly
Dave Hansen i...@hotmail.com wrote:
In this code=2C the handle_input function falls into an infinite loop if pl=
ain char is signed. This is because key gets promoted (to signed int) befo=
re the comparison with EXIT_KEY (which is already signed int). If plain c=
har is signed=2C and key
I am still very puzzled over why the compiler balks wether I use signed or
unsigned chars to feed lcd_puts.
When I used unsigned char it balked. When I used char, it didn't.
Now when I use int8_t or uint8_t, it balks.
___
AVR-GCC-list mailing list
The way I deal with this is to think of char as a distinct type different
than unsigned or signed char. The compiler certainly thinks that way. So,
either keep all your type's the same, or, cast. But don't mix and match
char with the others - the compiler is complaining because it will mess
David VanHorn wrote:
I was originally declaring my variable passed to lcd_puts as
signed char LCD_String[LCD_Line_Len + 1]
This, after discovering to my surprise that lcd_puts wants signed chars.
Recently, I've converted to the portable typedefs as
unit8_t and int8_t
Now, whichever of
Georg-Johann Lay schrieb:
Hi guys, in pass .166r.split1, avr-gcc makes a wrong transformation for
the following testcase, compiled with -O:
void g(unsigned char);
void f1(unsigned x)
{
unsigned char y;
y = (x 12) 0x0F;
g(y);
}
To be more specific, I attached the asm
I know what *I* am missing - the source code! How is anyone supposed to
help you with your problem until you post the actual compilable code
snippet? We need a compilable code sample which demonstrates the problem,
along with the compiler flags you used and also the compiler version you
Dave Hansen wrote:
From: david.br...@hesbynett.no
[...char vs. signed cahr vs. unsigned char...]
Don't look it up - if you learn the compiler's default behaviour, you
risk writing incorrect code. If it is in any way relevant whether a
char is signed or not, write signed char or unsigned
From: j...@uriah.heep.sax.de
Dave Hansen i...@hotmail.com wrote:
In this code=2C the handle_input function falls into an infinite loop if pl=
ain char is signed. This is because key gets promoted (to signed int) befo=
re the comparison with EXIT_KEY (which is already signed int). If
From: i...@hotmail.com
That would work. Another way is to have get_key return int.
Oops. I mean, of course, make key an int. Having get_key return an int that
is then stored into a char would accomplish... nothing.
Regards,
-=Dave
Express your personality in color!
Correction: The routine in question is lcd_putc not lcd_puts.
___
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
Hi,
I'm assuming you meant to post this on the mailing list rather than just
to me. It's easy to press the Reply button on your mail program
rather than the Reply All - it's a mistake we've all made on occasion.
There was some good reason for the mailing list being configured the
way it
On Mon, Mar 30, 2009 at 2:48 PM, David VanHorn d...@mobilefusioninc.com wrote:
I thought I must be doing something fairly trivial wrong, this IS
only my second project in C...
Dave, I have two recommendations for a beginner at C.
1) Buy yourself a copy of Gimpel Lint, even if you have to pay
I learned to code C/C++ with the dummies book, it gave pretty clear
examples.
C doesn't have to be hard, just take the time to grock it and not
rush it.
Also, this is a great read for understanding social dynamics on how to
ask people questions and get an answer.
Weddington, Eric eric.wedding...@atmel.com wrote:
For version 1.47 of SRecord, look at the Makefile.in file in the top
level. Lines 54-57 state:
Both, CFLAGS and CXXFLAGS in autoconf-generated Makefiles should
include CPPFLAGS. This is done outside Makefile.am.
The point is that any
Bob Paddock wrote:
On Mon, Mar 30, 2009 at 2:48 PM, David VanHorn d...@mobilefusioninc.com wrote:
I thought I must be doing something fairly trivial wrong, this IS
only my second project in C...
Dave, I have two recommendations for a beginner at C.
1) Buy yourself a copy of Gimpel Lint, even
18 matches
Mail list logo