Skip to content

compile error in _fileio.c (cygwin) #48195

Closed

Description

@ocean-city
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']

    Activity

    1. ocean-city commented on Sep 23, 2008

      ocean-citymannequin
      MannequinAuthor

      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 },
    2. added
      build
      on Sep 23, 2008
    3. amauryfa commented on Sep 23, 2008

      @amauryfa
      Contributor

      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).

    4. ocean-city commented on Sep 23, 2008

      ocean-citymannequin
      MannequinAuthor

      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?

    5. amauryfa commented on Sep 23, 2008

      @amauryfa
      Contributor

      OK, please apply!

    6. ocean-city commented on Sep 23, 2008

      ocean-citymannequin
      MannequinAuthor

      Thanks, fixed in r66566(trunk).

    7. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      buildeasy

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions