Re: [avr-gcc-list] Bug in *rotlsi3 insns?

2009-03-30 Thread Georg-Johann Lay
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

RE: [avr-gcc-list] Re: build srecord under mingw

2009-03-30 Thread Weddington, Eric
-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:

RE: [avr-gcc-list] Re: Passing a string variable to lcd_puts

2009-03-30 Thread Dave Hansen
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

Re: [avr-gcc-list] Re: Passing a string variable to lcd_puts

2009-03-30 Thread Joerg Wunsch
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

Re: [avr-gcc-list] Re: Passing a string variable to lcd_puts

2009-03-30 Thread David VanHorn
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

RE: [avr-gcc-list] Re: Passing a string variable to lcd_puts

2009-03-30 Thread Larry Barello
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

[avr-gcc-list] Re: Passing a string variable to lcd_puts

2009-03-30 Thread David Brown
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

Re: [avr-gcc-list] [WinAVR 20090313] Bug in split-Pattern for swap

2009-03-30 Thread Georg-Johann Lay
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

Re: [avr-gcc-list] Re: Passing a string variable to lcd_puts

2009-03-30 Thread David VanHorn
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

[avr-gcc-list] Re: Passing a string variable to lcd_puts

2009-03-30 Thread David Brown
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

RE: [avr-gcc-list] Re: Passing a string variable to lcd_puts

2009-03-30 Thread Dave Hansen
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

RE: [avr-gcc-list] Re: Passing a string variable to lcd_puts

2009-03-30 Thread Dave Hansen
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!

Re: [avr-gcc-list] Re: Passing a string variable to lcd_puts

2009-03-30 Thread David VanHorn
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

[avr-gcc-list] Re: Passing a string variable to lcd_puts

2009-03-30 Thread David Brown
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

Re: [avr-gcc-list] Re: Passing a string variable to lcd_puts

2009-03-30 Thread Bob Paddock
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

Re: [avr-gcc-list] Re: Passing a string variable to lcd_puts

2009-03-30 Thread Steven Michalske
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.

Re: [avr-gcc-list] Re: build srecord under mingw [SOLVED]

2009-03-30 Thread Joerg Wunsch
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

[avr-gcc-list] Re: Passing a string variable to lcd_puts

2009-03-30 Thread David Brown
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