This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 91167 - printf(
printf(
Status: CLOSED WONTFIX
Product: eCos
Classification: Retired
Component: C library (Show other bugs)
CVS
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jonathan Larmour
Jonathan Larmour
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-05-19 13:26 EDT by Bob Holmberg
Modified: 2007-04-18 12:53 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-06-20 12:26:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Bob Holmberg 2003-05-19 13:26:16 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) Opera 7.11  [en]

Description of problem:
printf("%d,%ld",a,b); 
incorrectly prints unsigned when int or long is negative
===
CODE:
===
#include <stdio.h>
#include <cyg/infra/diag.h>

int
main(void)
{
  int  a = -1;
  long b = -1;
       printf("     printf: -1 --> %d, %ld\n",a,b);
  diag_printf("diag_printf: -1 --> %d, %ld\n",a,b);
}
===
OUTPUT:
     printf: -1 --> 4294967295,4294967295
diag_printf: -1 --> -1, -1
==
Target: 
  i386, "net" flavor
eCos:
  2.0 beta with CVS update 2003-05-12
Compiler:
  i386-elf-gcc (GCC) 3.2.1 (eCosCentric)
  under Cygwin on win2K


Version-Release number of selected component (if applicable):
2.0 beta CVS 2003-05-12

How reproducible:
Always

Steps to Reproduce:
1.compile code:
i386-elf-gcc -Iecos-20b/ecos_install/include -g -DDEBUG 
-Wall -Wshadow -Winline -Wpointer-arith -Wstrict-prototypes -Winline 
-Wundef -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti 
-fvtable-gc -Woverloaded-virtual printf_long.cpp -c -o printf_long.o
2. link code:
i386-elf-gcc printf_long.o -nostartfiles
-Lecos-20b/ecos_install/lib -Ttarget.ld -g -nostdlib 
-Wl,--gc-sections -Wl,-static -o printf_long.exe
3. download and run with Insight Debugger on i386 target


Actual Results:       
     printf: -1 --> 4294967295,4294967295
diag_printf: -1 --> -1, -1


Expected Results:       
     printf: -1 --> -1, -1
diag_printf: -1 --> -1, -1


Additional info:
Comment 1 Alex Schuilenburg 2003-06-20 12:26:01 EDT
This bug has moved to http://bugs.ecos.sourceware.org/show_bug.cgi?id=91167

Note You need to log in before you can comment on or make changes to this bug.