php.net |  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
Votes:1
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
 [2005-02-21 14:35 UTC] mcihar at suse dot cz
Description:
------------
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 @@
 #endif

 #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"


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-06 17:24 UTC] sniper@php.net
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: Tue Oct 08 21:01:27 2024 UTC