Patches item #1191065, was opened at 2005-04-27 17:02
Message generated for change (Comment added) made by loewis
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1191065&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core (C code)
Group: Python 2.4
>Status: Closed
>Resolution: Accepted
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.
----------------------------------------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2006-04-15 10:36
Message:
Logged In: YES
user_id=21627
Thanks for the patch. It didn't apply cleanly, so I redid it
and committed it as r45418 and r45419.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1191065&group_id=5470
_______________________________________________
Patches mailing list
[email protected]
http://mail.python.org/mailman/listinfo/patches