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

compile error in _fileio.c (cygwin) #48195

Closed
ocean-city mannequin opened this issue Sep 23, 2008 · 5 comments
Closed

compile error in _fileio.c (cygwin) #48195

ocean-city mannequin opened this issue Sep 23, 2008 · 5 comments
Labels
build The build process and cross-build easy

Comments

@ocean-city
Copy link
Mannequin

ocean-city mannequin commented Sep 23, 2008

BPO 3945
Nosy @amauryfa
Files
  • _fileio.patch
  • _fileio.patch: version2
  • 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 2008-09-23.16:12:07.863>
    created_at = <Date 2008-09-23.13:41:36.818>
    labels = ['easy', 'build']
    title = 'compile error in _fileio.c (cygwin)'
    updated_at = <Date 2008-09-23.16:12:07.862>
    user = 'https://bugs.python.org/ocean-city'

    bugs.python.org fields:

    activity = <Date 2008-09-23.16:12:07.862>
    actor = 'ocean-city'
    assignee = 'none'
    closed = True
    closed_date = <Date 2008-09-23.16:12:07.863>
    closer = 'ocean-city'
    components = ['Build']
    creation = <Date 2008-09-23.13:41:36.818>
    creator = 'ocean-city'
    dependencies = []
    files = ['11569', '11571']
    hgrepos = []
    issue_num = 3945
    keywords = ['patch', 'easy']
    message_count = 5.0
    messages = ['73639', '73643', '73645', '73646', '73647']
    nosy_count = 2.0
    nosy_names = ['amaury.forgeotdarc', 'ocean-city']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue3945'
    versions = ['Python 2.6']

    @ocean-city
    Copy link
    Mannequin Author

    ocean-city mannequin commented Sep 23, 2008

    Currently, fails to build trunk on cygwin.

    gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
    -Wstrict-prototypes -I. -
    I/home/WhiteRabbit/python-dev/trunk/./Include -I. -IInclude -I./Include
    -I/home/
    WhiteRabbit/python-dev/trunk/Include
    -I/home/WhiteRabbit/python-dev/trunk -c /ho
    me/WhiteRabbit/python-dev/trunk/Modules/_fileio.c -o
    build/temp.cygwin-1.5.25-i6
    86-2.6/home/WhiteRabbit/python-dev/trunk/Modules/_fileio.o
    /home/WhiteRabbit/python-dev/trunk/Modules/_fileio.c:834: error:
    initializer ele
    ment is not constant
    /home/WhiteRabbit/python-dev/trunk/Modules/_fileio.c:834: error: (near
    initializ
    ation for `PyFileIO_Type.ob_type')

    To fix this, attached patch is needed. Or, like py3k, using following
    Py_???_HEAD_INIT (surrounded with bracket) might fix this issue in trunk.

    #define PyObject_HEAD_INIT(type)	\
    	{ _PyObject_EXTRA_INIT		\
    	1, type },
    
    #define PyVarObject_HEAD_INIT(type, size)	\
    	{ PyObject_HEAD_INIT(type) size },

    @ocean-city ocean-city mannequin added build The build process and cross-build easy labels Sep 23, 2008
    @amauryfa
    Copy link
    Member

    The patch is OK, even if the second half is not necessary:
    PyType_Ready() takes care of the ob_type field.

    Adding brackets in the macro would be wrong: the object layout is
    different between 2.6 and 3.0.
    3.0 does not have this problem because _fileio.c is built-in and linked
    with the core interpreter (2.6 leaves it in an extension module).

    @ocean-city
    Copy link
    Mannequin Author

    ocean-city mannequin commented Sep 23, 2008

    The patch is OK, even if the second half is not necessary:
    PyType_Ready() takes care of the ob_type field.

    Oh, OK.

    Adding brackets in the macro would be wrong: the object layout is
    different between 2.6 and 3.0.

    I Undarstand.

    How about the attached patch?

    @amauryfa
    Copy link
    Member

    OK, please apply!

    @ocean-city
    Copy link
    Mannequin Author

    ocean-city mannequin commented Sep 23, 2008

    Thanks, fixed in r66566(trunk).

    @ocean-city ocean-city mannequin closed this as completed Sep 23, 2008
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    build The build process and cross-build easy
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant