[Bug 1214] New: inttypes.h's PRI*PTR uses %*ll where it should use %*l

rtems-bugs at rtems.org rtems-bugs at rtems.org
Mon Jan 29 08:23:57 UTC 2007


http://www.rtems.org/bugzilla/show_bug.cgi?id=1214

           Summary: inttypes.h's PRI*PTR uses %*ll where it should use %*l
           Product: Tools
           Version: unspecified
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Newlib
        AssignedTo: ralf.corsepius at rtems.org
        ReportedBy: ralf.corsepius at rtems.org


newlib-1.15.0's inttypes.h's implementation of the
PRI*PTR macros is broken.

The %*l macro being chosen doesn't correspond to the type being used as
intptr_t.

To reproduce, compile this:
> cat tmp.c
#include <stdio.h>
#include <inttypes.h>

int main()
{
  void *null = 0;
  printf( "%" PRIxPTR "\n", (intptr_t) null );
  return 0;
}


# for c in /opt/rtems-4.8/bin/*-rtems4.8-gcc; do \
echo "$c:"; $c -o tmp.o -Wall -c tmp.c; done

/opt/rtems-4.8/bin/arm-rtems4.8-gcc:
tmp.c: In function 'main':
tmp.c:7: warning: format '%llx' expects type 'long long unsigned int', but
argument 2 has type 'long int'

/opt/rtems-4.8/bin/avr-rtems4.8-gcc:
tmp.c: In function 'main':
tmp.c:7: warning: format '%llx' expects type 'long long unsigned int', but
argument 2 has type 'int'

/opt/rtems-4.8/bin/bfin-rtems4.8-gcc:
tmp.c: In function 'main':
tmp.c:7: warning: format '%llx' expects type 'long long unsigned int', but
argument 2 has type 'long int'

/opt/rtems-4.8/bin/h8300-rtems4.8-gcc:
tmp.c: In function 'main':
tmp.c:7: warning: format '%llx' expects type 'long long unsigned int', but
argument 2 has type 'int'

/opt/rtems-4.8/bin/i386-rtems4.8-gcc:
tmp.c: In function 'main':
tmp.c:7: warning: format '%llx' expects type 'long long unsigned int', but
argument 2 has type 'long int'

/opt/rtems-4.8/bin/m68k-rtems4.8-gcc:
tmp.c: In function 'main':
tmp.c:7: warning: format '%llx' expects type 'long long unsigned int', but
argument 2 has type 'long int'

/opt/rtems-4.8/bin/mips-rtems4.8-gcc:
tmp.c: In function 'main':
tmp.c:7: warning: format '%llx' expects type 'long long unsigned int', but
argument 2 has type 'int'

/opt/rtems-4.8/bin/powerpc-rtems4.8-gcc:
tmp.c: In function 'main':
tmp.c:7: warning: format '%llx' expects type 'long long unsigned int', but
argument 2 has type 'int'

/opt/rtems-4.8/bin/sparc-rtems4.8-gcc:
tmp.c: In function 'main':
tmp.c:7: warning: format '%llx' expects type 'long long unsigned int', but
argument 2 has type 'int'

/opt/rtems-4.8/bin/tic4x-rtems4.8-gcc:
tmp.c: In function `main':
tmp.c:7: warning: long long unsigned int format, different type arg (arg 2)


Affected are all targets on all rtems branches.


-- 
Configure bugmail: http://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.
You are the assignee for the bug, or are watching the assignee.



More information about the bugs mailing list