php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34977 Compile failure due to use of varargs.h
Submitted: 2005-10-25 15:57 UTC Modified: 2005-10-26 15:52 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: ralph at cs dot cf dot ac dot uk Assigned: tony2001 (profile)
Status: Closed Package: Compile Failure
PHP Version: 5CVS-2005-10-25 (snap) OS: MacOS X 10.4.x
Private report: No CVE-ID: None
 [2005-10-25 15:57 UTC] ralph at cs dot cf dot ac dot uk
Description:
------------
Trying to compile snapshot php5-200510251230 on MacOS 10.4.x 
with latest Apple Developer Tools

gives

/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include/varargs.h:
4:2: error: #error "GCC no longer implements <varargs.h>."
/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include/varargs.h:
5:2: error: #error "Revise your code to use <stdarg.h>."


Reproduce code:
---------------
N/A

Expected result:
----------------
Compile

Actual result:
--------------
/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include/varargs.h:
4:2: error: #error "GCC no longer implements <varargs.h>."
/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include/varargs.h:
5:2: error: #error "Revise your code to use <stdarg.h>."


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-25 15:58 UTC] ralph at cs dot cf dot ac dot uk
Error generated from the following file:

In file included from /usr/local/src/php5-200510251230/ext/
mbstring/oniguruma/regerror.c:37:
 [2005-10-25 22:45 UTC] tony2001@php.net
Does the code below compiles ok on your host? 
(just `gcc test.c -o test` should be fine).

#include <stdarg.h>

int foo(int x, ...) {
    va_list va;
    va_start(va, x);
    va_arg(va, int);
    va_arg(va, char *);
    va_arg(va, double);
    return 0;
}
int main() { return foo(10, "", 3.14); }

 [2005-10-26 09:46 UTC] ralph at cs dot cf dot ac dot uk
Yes, the code supplied compiles just fine.

Somehow, when compiling php, it tries to pick up the varargs 
header instead of the stdarg one.

varargs.h contains just the following, leading to the 
messages reported earlier:

#ifndef _VARARGS_H
#define _VARARGS_H

#error "GCC no longer implements <varargs.h>."
#error "Revise your code to use <stdarg.h>."

#endif
 [2005-10-26 09:52 UTC] tony2001@php.net
Yes, varargs.h contains the same here (Linux).
Please put your config.log somewhere and paste the URL here.
 [2005-10-26 09:59 UTC] ralph at cs dot cf dot ac dot uk
My config.log file is available for the time being at
http://ralph.cs.cf.ac.uk/config.log
 [2005-10-26 12:54 UTC] tony2001@php.net
Please try this patch:
http://tony2001.phpclub.net/dev/tmp/bug34977.diff
Remove config.cache and run ./buildconf && ./configure again after applying it.
 [2005-10-26 14:57 UTC] ralph at cs dot cf dot ac dot uk
Yes, this patch fixes the compilation bug.

Just to be safe I also checked that the compiled snapshot now 
passes most of the tests, too.

Thanks.

[I have now removed my config.log file.]
 [2005-10-26 15:09 UTC] tony2001@php.net
Jani, could you plz check the patch?
thanks.
 [2005-10-26 15:39 UTC] sniper@php.net
Antony, if it works just commit. I can't test it right now, but I don't see any problems with the change either.

 [2005-10-26 15:52 UTC] tony2001@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC