[Patches] [ python-Patches-1191065 ] socketmodule.c's recvfrom on
OSF/1 4.0
SourceForge.net
noreply at sourceforge.net
Wed Apr 27 17:02:59 CEST 2005
Patches item #1191065, was opened at 2005-04-27 17:02
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1191065&group_id=5470
Category: Core (C code)
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Marcel Martin (mmar)
Assigned to: Nobody/Anonymous (nobody)
Summary: socketmodule.c's recvfrom on OSF/1 4.0
Initial Comment:
Compilation of Modules/socketmodule.c fails on OSF/1 4.0
with GCC versions 3.1 and 3.2.
The error message is:
python/dist/src/Modules/socketmodule.c:2139:1: directives
may not be used inside a macro argument
Line 2139 is in function sock_recvfrom(). The problem is
that the function recvfrom() on the machine I use is a macro
and the parameters for it are pieced together by use of #if
instructions to the preprocessor, similar to the following
code:
-------
#include <stdio.h>
#define macro(a, b) printf("Test: %d %d\n", a, b)
int main(int argc, char** argv) {
macro(1, 2); // works
macro(1,
#if defined(SOMETHING)
1 // error message here with older GCC
#else
2
#endif
);
return 0;
}
-------
This small test compiles with GCC 3.4, but with none of
2.95.3, 3.1, or 3.2.
The problem was in Python 2.3.4, 2.4.1 and CVS HEAD.
The attached patch (against CVS HEAD) fixes the problem
by pulling the "#if"s out of the parameter list. Not as nice as
before, but it works for me.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1191065&group_id=5470
More information about the Patches
mailing list