|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32045 Warnings when compiling posix.c
Submitted: 2005-02-21 14:35 UTC Modified: 2005-03-07 12:01 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: mcihar at suse dot cz Assigned:
Status: Wont fix Package: Compile Warning
PHP Version: 5.0.3 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
46 + 2 = ?
Subscribe to this entry?

 [2005-02-21 14:35 UTC] mcihar at suse dot cz
php-5.0.3/ext/posix/posix.c: In function `zif_posix_getpgid':
php-5.0.3/ext/posix/posix.c:374: warning: implicit declaration of function `getpgid'
php-5.0.3/ext/posix/posix.c: In function `zif_posix_getsid':
php-5.0.3/ext/posix/posix.c:384: warning: implicit declaration of function `getsid'

fix is simple, see man page for getpgid for detailed description:

--- ext/posix/posix.c.orig      2004-04-18 23:49:10.000000000 +0200
+++ ext/posix/posix.c   2005-02-21 13:01:50.452549636 +0100
@@ -23,6 +23,8 @@

 #include "php.h"
+/* Needed to get getpgid and getsid */
+#define  _XOPEN_SOURCE 500
 #include <unistd.h>
 #include "ext/standard/info.h"
 #include "ext/standard/php_string.h"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-06 17:24 UTC]
Not only does that fix not work, but it might cause more problems than it tries to fix -> wont fix. (that warning is harmless)

 [2005-03-07 12:01 UTC] mcihar at suse dot cz
From getpgid(2):

To get the prototypes under glibc, define both _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED, or use "#define _XOPEN_SOURCE n" for some integer n larger than or equal to 500.

And yes, it did fix the warning for me.

These warning can cause problem when pid_t is not int, however I don't know whether such platform exist.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 19 13:01:28 2024 UTC