After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 50815 - Incorrect assumption on pid_t
Incorrect assumption on pid_t
Status: RESOLVED FIXED
Product: gnome-libs
Classification: Deprecated
Component: general
1.2.x
Other All
: Normal major
: 1.4.1
Assigned To: gnome-libs Maintainers
gnome-libs Maintainers
Depends on:
Blocks:
 
 
Reported: 2001-02-12 22:19 UTC by Morten Welinder
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to cast pid_t to a long (3.84 KB, patch)
2002-01-27 00:30 UTC, Kjartan Maraas
none Details | Review

Description Morten Welinder 2001-02-12 22:19:04 UTC
Parts of gnome-libs thinks pid_t is int.  That may or may not be true.
I suggest casting to long and using "%ld".  Not perfect, but C does
not leave many options.



gnome-exec.c: In function `gnome_execute_async_with_env_fds':
gnome-exec.c:210: warning: int format, pid_t arg (arg 4)

gnome-moz-remote.c: In function `mozilla_remote_obtain_lock':
gnome-moz-remote.c:332: warning: int format, pid_t arg (arg 4)

gnome-client.c: In function `gnome_client_set_process_id':
gnome-client.c:1656: warning: int format, pid_t arg (arg 4)

gnome-client.c: In function `gnome_real_client_connect':
gnome-client.c:2216: warning: int format, pid_t arg (arg 4)

gnome_segv.c: In function `main':
gnome_segv.c:135: warning: int format, pid_t arg (arg 4)
gnome_segv.c:154: warning: int format, pid_t arg (arg 4)

debug.c: In function `__rsd_setDebugLevels':
debug.c:356: warning: int format, pid_t arg (arg 3)
Comment 1 Kjartan Maraas 2001-06-15 12:16:55 UTC
What flags are used here? I get no warnings on a standard run with
gcc-2.96 from Red Hat 7.1
Comment 2 Morten Welinder 2001-06-15 15:02:32 UTC
No special flags, gcc-2.7.2, if I recall.

But you miss the point.  On your system, it might very well be
that pid_t is an int.  Then you would not get the warning,
even though the code is not right.  On my system, however,
pid_t is not an int.  I think it's a long.

FYI, this is a Solaris system.
Comment 3 Kjartan Maraas 2002-01-27 00:30:11 UTC
Created attachment 6529 [details] [review]
Patch to cast pid_t to a long
Comment 4 Kjartan Maraas 2002-01-27 00:30:44 UTC
Is this ok? I'm not sure if I should cast the calls to getpid() too?
Comment 5 Kjartan Maraas 2002-03-18 22:18:29 UTC
Marking fixed. Please repoen with details on any cases that are missing.