Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socketmodule.c's recvfrom on OSF/1 4.0 #41913

Closed
mmar mannequin opened this issue Apr 27, 2005 · 2 comments
Closed

socketmodule.c's recvfrom on OSF/1 4.0 #41913

mmar mannequin opened this issue Apr 27, 2005 · 2 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@mmar
Copy link
Mannequin

mmar mannequin commented Apr 27, 2005

BPO 1191065
Nosy @loewis
Files
  • python-directive-inside-macro.patch: "directives inside macro" patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2006-04-15.08:36:46.000>
    created_at = <Date 2005-04-27.15:02:59.000>
    labels = ['interpreter-core']
    title = "socketmodule.c's recvfrom on OSF/1 4.0"
    updated_at = <Date 2006-04-15.08:36:46.000>
    user = 'https://bugs.python.org/mmar'

    bugs.python.org fields:

    activity = <Date 2006-04-15.08:36:46.000>
    actor = 'loewis'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2005-04-27.15:02:59.000>
    creator = 'mmar'
    dependencies = []
    files = ['6634']
    hgrepos = []
    issue_num = 1191065
    keywords = ['patch']
    message_count = 2.0
    messages = ['48263', '48264']
    nosy_count = 2.0
    nosy_names = ['loewis', 'mmar']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1191065'
    versions = ['Python 2.4']

    @mmar
    Copy link
    Mannequin Author

    mmar mannequin commented Apr 27, 2005

    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.

    @mmar mmar mannequin closed this as completed Apr 27, 2005
    @mmar mmar mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Apr 27, 2005
    @mmar mmar mannequin closed this as completed Apr 27, 2005
    @mmar mmar mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Apr 27, 2005
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Apr 15, 2006

    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.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants