#2983 closed defect (fixed)

Create <rtems/inttypes.h> to consolidate extensions to <inttypes.h>

Reported by: Joel Sherrill Owned by: Joel Sherrill <joel@…>
Priority: normal Milestone: 5.1
Component: unspecified Version: 5
Severity: normal Keywords: printf, inttypes.h
Cc: Blocked By:
Blocking:

Description

Per discussion at https://lists.rtems.org/pipermail/devel/2017-April/017483.html, create <rtems/inttypes.h> to consolidate extensions to the C99 <inttypes.h> file. A quick search shows that there are the following set of defines which could be consolidated as a starting point. Then these are available to address other printf() format warnings.

$ grep -r "#define PRI" . | grep -v PRIORITY | grep -v PRINT

./cpukit/libmisc/shell/main_time.c:#define PRIdtime_t PRId64
./cpukit/libmisc/shell/main_time.c:#define PRIdtime_t PRId32
./cpukit/libmisc/uuid/gen_uuid.c:#define PRIutime_t PRIu64
./cpukit/libmisc/uuid/gen_uuid.c:#define PRIutime_t PRIu32
./cpukit/libdl/rtl-shell.c:#define PRIdoff_t PRIo32
./cpukit/libdl/rtl-shell.c:#define PRIdoff_t PRIo64
./cpukit/libfs/src/nfsclient/src/dirutils.c:#define PRIomode_t PRIo64
./cpukit/libfs/src/nfsclient/src/dirutils.c:#define PRIomode_t PRIo32
./cpukit/libfs/src/nfsclient/src/dirutils.c:#define PRIdoff_t PRIo64
./cpukit/libfs/src/nfsclient/src/dirutils.c:#define PRIdoff_t PRIo32
./cpukit/libfs/src/rfs/rtems-rfs-dir.c:#define PRIooff_t PRIo64
./cpukit/libfs/src/rfs/rtems-rfs-dir.c:#define PRIooff_t PRIo32
./cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c:#define PRIdoff_t PRId64
./cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c:#define PRIdoff_t PRId32
./cpukit/libfs/src/rfs/rtems-rfs-rtems.c:#define PRIomode_t PRIo64
./cpukit/libfs/src/rfs/rtems-rfs-rtems.c:#define PRIomode_t PRIo32
./testsuites/psxtests/include/pmacros.h:#define PRIdoff_t PRIo64
./testsuites/psxtests/include/pmacros.h:#define PRIdoff_t PRIo32
./testsuites/psxtests/include/pmacros.h:#define PRIxblksize_t PRIx64
./testsuites/psxtests/include/pmacros.h:#define PRIxblksize_t PRIx32
./testsuites/psxtests/include/pmacros.h:#define PRIxblksize_t "lx"
./testsuites/psxtests/include/pmacros.h:#define PRIxblkcnt_t PRIx64
./testsuites/psxtests/include/pmacros.h:#define PRIxblkcnt_t PRIx32
./testsuites/psxtests/include/pmacros.h:#define PRIxblkcnt_t "lx"
./testsuites/libtests/termios01/init.c:#define PRIdrtems_termios_baud_t PRId32
./testsuites/support/include/pritime.h:#define PRIdtime_t PRId64
./testsuites/support/include/pritime.h:#define PRIdtime_t PRId32
./testsuites/support/include/tmacros.h:#define PRIxrtems_id PRIx16
./testsuites/support/include/tmacros.h:#define PRIxrtems_id PRIx32
./testsuites/support/include/tmacros.h:#define PRIdPriority_Control PRIu64
./testsuites/support/include/tmacros.h:#define PRIxPriority_Control PRIx64
./testsuites/support/include/tmacros.h:#define PRIdrtems_task_priority PRIu32
./testsuites/support/include/tmacros.h:#define PRIxrtems_task_priority PRIx32
./testsuites/support/include/tmacros.h:#define PRIdWatchdog_Interval PRIu32
./testsuites/support/include/tmacros.h:#define PRIdrtems_interval PRIdWatchdog_Interval
./testsuites/support/include/tmacros.h:#define PRIdThread_Entry_numeric_type PRIuPTR
./testsuites/support/include/tmacros.h:#define PRIdrtems_task_argument PRIdThread_Entry_numeric_type
./testsuites/support/include/tmacros.h:#define PRIxrtems_event_set PRIx32
./testsuites/support/include/tmacros.h:#define PRIxpthread_t PRIx32
./testsuites/support/include/tmacros.h:#define PRIxrtems_signal_set PRIx32
./testsuites/support/include/tmacros.h:#define PRIxino_t "lx"
./testsuites/support/include/primode.h:#define PRIomode_t PRIo64
./testsuites/support/include/primode.h:#define PRIomode_t PRIo32
./testsuites/sptests/sp21/init.c:#define PRIurtems_device_major_number PRIu32
./testsuites/sptests/sp08/init.c:#define PRIxModes_Control PRIx32
./testsuites/sptests/sp08/init.c:#define PRIxrtems_mode PRIxModes_Control
./testsuites/sptests/sp47/init.c:#define PRIXModes_Control PRIX32
./testsuites/sptests/sp47/init.c:#define PRIXrtems_mode PRIXModes_Control

Change History (3)

comment:1 Changed on 04/18/17 at 16:25:09 by Joel Sherrill <joel@…>

Owner: set to Joel Sherrill <joel@…>
Resolution: fixed
Status: newclosed

In d420b67/rtems:

Merge tmacros.h PRIxxx constants from testsuites/ into <rtems/inttypes.h>

This completes the initial creation of rtems/inttypes.h based on all
existing PRIxxx definitions contained in RTEMS Project owned code.

closes #2983.

comment:2 Changed on 05/11/17 at 07:31:02 by Sebastian Huber

Milestone: 4.124.12.0

comment:3 Changed on 11/09/17 at 06:27:14 by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.