Topic : small printf strange behavior

Forum : ARM

Original Post
Post Information Post
August 14, 2008 - 5:24pm
Guest

Hello,

Using Ride7 7.01.002 with RKitARM 1.03.004, compiling with small printf :

DOES NOT work: (Build failed)

printf("x"); // or any single char, could be "5","g" and so on, no specific relation to "%x"

DO work:

printf("xx"); // more than one single char

Any hints about this situation ?

Regards,
Dave

Replies
Post Information Post
+1
0
-1
August 15, 2008 - 11:01am
Guest

davidb wrote:
DOES NOT work: (Build failed)

In what way does it "fail" - what message(s) do you get?
+1
0
-1
August 15, 2008 - 7:28pm
Guest

I obtain the following messages :

[Start of messages here]
[other messages cut]

Building D:\Programmation\Test H1\Hardware test\H1_test.rapp 
 Running : LD 
 \"D:\Programmation\ARM\Raisonance\Ride7\arm-gcc\bin\arm-none-eabi-gcc.exe" -mcpu=arm7tdmi  -mthumb-interwork -Wl,-T -Xlinker "D:\Programmation\Test H1\Hardware test\H1_test.elf.ld" -u _start -Wl,-static -Wl,--gc-sections -nostartfiles -Wl,-Map -Xlinker "D:\Programmation\Test H1\Hardware test\H1_test.map"   
 d:/programmation/arm/raisonance/ride7/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib\libc.a(lib_a-makebuf.o): In function `__smakebuf':  
 makebuf.c:(.text+0xf8): undefined reference to `isatty'  
 d:/programmation/arm/raisonance/ride7/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':  
 sbrkr.c:(.text+0x18): undefined reference to `_sbrk'  
 d:/programmation/arm/raisonance/ride7/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib\libc.a(lib_a-writer.o): In function `_write_r':  
 writer.c:(.text+0x20): undefined reference to `_write'  
 d:/programmation/arm/raisonance/ride7/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib\libc.a(lib_a-closer.o): In function `_close_r':  
 closer.c:(.text+0x18): undefined reference to `_close'  
 d:/programmation/arm/raisonance/ride7/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib\libc.a(lib_a-fstatr.o): In function `_fstat_r':  
 fstatr.c:(.text+0x1c): undefined reference to `_fstat'  
 d:/programmation/arm/raisonance/ride7/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib\libc.a(lib_a-lseekr.o): In function `_lseek_r':  
 lseekr.c:(.text+0x20): undefined reference to `_lseek'  
 d:/programmation/arm/raisonance/ride7/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib\libc.a(lib_a-readr.o): In function `_read_r':  
 readr.c:(.text+0x20): undefined reference to `_read'  
 collect2: ld returned 1 exit status  
  
Build failed 

[End of messages here]

Any idea ?
+1
0
-1
August 15, 2008 - 7:29pm
Guest

Sorry about the stupid emoticons, i saw them after posting the error messages...

+1
0
-1
August 20, 2008 - 10:02am
Raisonance Support Team

you can use the "["code"]" ..."["/code"]" tags (remove the quotes) to prevent the emoticons...
I edited your message accordingly.

I guess that the front-end of the compiler replaces printf("x"); by a direct single-char write that in some way is not the same as our putchar...

We will need more time to invetigate on this, so for now I suggest that you replace
printf("x");
by
putchar('x');

VincentC

+1
0
-1
August 21, 2008 - 2:43pm
Guest

Thank you for the advices.
I found strange that using printf() with a single char caused such a behavior.

Anyway, i'm just an hardware guy wandering outside his territory...

Thank your !