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

%zd configure test fails on Linux #45979

Closed
hniksic mannequin opened this issue Dec 16, 2007 · 6 comments
Closed

%zd configure test fails on Linux #45979

hniksic mannequin opened this issue Dec 16, 2007 · 6 comments
Assignees

Comments

@hniksic
Copy link
Mannequin

hniksic mannequin commented Dec 16, 2007

BPO 1638
Nosy @gvanrossum, @loewis, @tiran, @hniksic
Files
  • 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 = 'https://github.com/tiran'
    closed_at = <Date 2007-12-18.21:15:29.315>
    created_at = <Date 2007-12-16.20:22:53.605>
    labels = []
    title = '%zd configure test fails on Linux'
    updated_at = <Date 2007-12-18.21:15:29.313>
    user = 'https://github.com/hniksic'

    bugs.python.org fields:

    activity = <Date 2007-12-18.21:15:29.313>
    actor = 'christian.heimes'
    assignee = 'christian.heimes'
    closed = True
    closed_date = <Date 2007-12-18.21:15:29.315>
    closer = 'christian.heimes'
    components = []
    creation = <Date 2007-12-16.20:22:53.605>
    creator = 'hniksic'
    dependencies = []
    files = ['8966']
    hgrepos = []
    issue_num = 1638
    keywords = []
    message_count = 6.0
    messages = ['58675', '58676', '58677', '58678', '58762', '58772']
    nosy_count = 4.0
    nosy_names = ['gvanrossum', 'loewis', 'christian.heimes', 'hniksic']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1638'
    versions = ['Python 2.5']

    @hniksic
    Copy link
    Mannequin Author

    hniksic mannequin commented Dec 16, 2007

    The printf("%zd", ...) configure test fails on Linux, although it
    supports the %zd format. config.log reveals that the test tests for %zd
    with Py_ssize_t, which is (within the test) typedeffed to ssize_t. But
    the appropriate system header is not included by the test, and ssize_t
    is not defined. This results in Py_ssize_t not being correctly defined,
    and the test failing.

    According to http://tinyurl.com/3dhbbm/, ssize_t is defined in
    <sys/types.h>. Adding #include <sys/types.h> manually to the test fixes
    the test for me. A patch like the one attached should fix the problem.

    @tiran
    Copy link
    Member

    tiran commented Dec 16, 2007

    I fixed the bug in r59533 trunk with a modified patch:

    #ifdef HAVE_SYS_TYPES_H
    #include <sys/types.h>
    #endif

    Should it be backported to 2.5? It will be merged into 3.0 automatically.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Dec 16, 2007

    I think it should be backported.

    @hniksic
    Copy link
    Mannequin Author

    hniksic mannequin commented Dec 16, 2007

    Thanks for the quick review.  I considered guarding the include with
    #ifdef as well, but I concluded it's not necessary for the following
    reasons:
    1. a large number of existing tests already simply include <sys/types.h>
      (the makedev test, sizeof(off_t) test, IPv6-related tests, and various
      socket tests);

    2. if sys/types.h doesn't exist, the test will fail, and Python will
      conclude that %zd is not available. This conclusion is almost certainly
      correct, as I doubt that a system without sys/types.h has a working %zd
      format.

    @gvanrossum
    Copy link
    Member

    Please backport.

    @tiran
    Copy link
    Member

    tiran commented Dec 18, 2007

    Backported to 2.5 in r59552

    @tiran tiran closed this as completed Dec 18, 2007
    @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
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants