Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - printf to print a value not working : (3 Items)
   
printf to print a value not working  
We are seeing issues with printf() function in QNX.
printf() output is seen if it takes a string as argument
For ex:
printf("abc");

But  no output is seen while printing a value
For ex:
printf("%d", a);
or
printf("value  = %d", a);


Can you give some pointers on the solution for this issue.

The platform is IMX6 (freescale, armle).

Regards
Kaushik
Re: printf to print a value not working  
On 14-03-24 01:17 PM, Roy Jose wrote:
> We are seeing issues with printf() function in QNX.
> printf() output is seen if it takes a string as argument
> For ex:
> printf("abc");
>
> But  no output is seen while printing a value
> For ex:
> printf("%d", a);
> or
> printf("value  = %d", a);
>
>
> Can you give some pointers on the solution for this issue.

Can you check to make sure you're not intermixing the ABIs? e.g. ARM 
EABI libc.so.3, but the executable is ARM OBAI (GNU APCS), or vice 
versa? The ABIs have a different calling convention, and might result in 
the issue you're seeing

You'd want to make sure you're using qcc -Vgcc_ntoarmv7le and 
arm-unknown-nto-qnx.6.5.0eabi-gcc, with the  $QNX_TARGET/armle-v7 OS 
variant, and qcc -Vgcc_ntoarmle and arm-unknown-nto-qnx.6.5.0-gcc with 
the $QNX_TARGET/armle/ OS variant.

Regards,

Ryan Mansfield

RE: printf to print a value not working  
Aren't you just missing the /n at the end? 
________________________________________
From: Ryan Mansfield [community-noreply@qnx.com]
Sent: Monday, March 24, 2014 1:22 PM
To: ostech-core_os@community.qnx.com
Subject: Re: printf to print a value not working

On 14-03-24 01:17 PM, Roy Jose wrote:
> We are seeing issues with printf() function in QNX.
> printf() output is seen if it takes a string as argument
> For ex:
> printf("abc");
>
> But  no output is seen while printing a value
> For ex:
> printf("%d", a);
> or
> printf("value  = %d", a);
>
>
> Can you give some pointers on the solution for this issue.

Can you check to make sure you're not intermixing the ABIs? e.g. ARM
EABI libc.so.3, but the executable is ARM OBAI (GNU APCS), or vice
versa? The ABIs have a different calling convention, and might result in
the issue you're seeing

You'd want to make sure you're using qcc -Vgcc_ntoarmv7le and
arm-unknown-nto-qnx.6.5.0eabi-gcc, with the  $QNX_TARGET/armle-v7 OS
variant, and qcc -Vgcc_ntoarmle and arm-unknown-nto-qnx.6.5.0-gcc with
the $QNX_TARGET/armle/ OS variant.

Regards,

Ryan Mansfield





_______________________________________________

OSTech
http://community.qnx.com/sf/go/post109593
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com