bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

printing pid_t values


From: Bernhard Voelker
Subject: printing pid_t values
Date: Wed, 6 Jan 2021 17:45:24 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

While pid_t is typedef'd to int on GNU/Linux platforms, it is a long on Solaris 
11:

  $ uname -a
  SunOS gcc-solaris11 5.11 11.3 sun4u sparc SUNW,SPARC-Enterprise

  $ echo '#include <sys/types.h>' | gcc -E - | grep -w pid_t
  typedef long pid_t;

There, one would need the %ld format when printing a pid_t's value.
Checking in gnulib, I only see it handled as %u or %d.
Do we have an issue here?
At least using both %u and %d looks inconsistent.

Thanks & have a nice day,
Berny



reply via email to

[Prev in Thread] Current Thread [Next in Thread]