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

./configure --with-stdc89 to test ANSI C conformity #48808

Closed
tiran opened this issue Dec 6, 2008 · 16 comments
Closed

./configure --with-stdc89 to test ANSI C conformity #48808

tiran opened this issue Dec 6, 2008 · 16 comments
Labels
build The build process and cross-build type-feature A feature request or enhancement

Comments

@tiran
Copy link
Member

tiran commented Dec 6, 2008

BPO 4558
Nosy @birkenfeld, @amauryfa, @vstinner, @tiran
Files
  • with_stdc89.patch
  • with_stdc89_2.patch
  • python-trunk-20081209-c89.patch: updated c89 patch for linux
  • python3-20110520-c89.patch: update
  • with_stdc89_3.patch
  • with_stdc89_3.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 2016-09-10.21:28:25.896>
    created_at = <Date 2008-12-06.02:25:26.040>
    labels = ['type-feature', 'build']
    title = './configure --with-stdc89 to test ANSI C conformity'
    updated_at = <Date 2016-09-10.21:28:25.895>
    user = 'https://github.com/tiran'

    bugs.python.org fields:

    activity = <Date 2016-09-10.21:28:25.895>
    actor = 'christian.heimes'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-09-10.21:28:25.896>
    closer = 'christian.heimes'
    components = ['Build']
    creation = <Date 2008-12-06.02:25:26.040>
    creator = 'christian.heimes'
    dependencies = []
    files = ['12246', '12247', '12294', '22035', '30686', '30687']
    hgrepos = []
    issue_num = 4558
    keywords = ['patch']
    message_count = 16.0
    messages = ['77097', '77102', '77106', '77141', '77144', '77146', '77148', '77149', '77156', '77240', '77369', '136338', '136413', '136438', '191765', '191766']
    nosy_count = 5.0
    nosy_names = ['georg.brandl', 'amaury.forgeotdarc', 'vstinner', 'christian.heimes', 'rpetrov']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue4558'
    versions = ['Python 3.3', 'Python 3.4']

    @tiran
    Copy link
    Member Author

    tiran commented Dec 6, 2008

    The patch adds a configure option --with-stdc89. It also fixes some edge
    cases in socketmodule.h and linuxaudiodev so all related modules can be
    build in c89 mode.

    I'm planning to add the configure option to the build bots in order to
    detect c89 incompatibilities like the usage of "inline" and // style
    comments.

    @tiran tiran added build The build process and cross-build type-feature A feature request or enhancement labels Dec 6, 2008
    @birkenfeld
    Copy link
    Member

    Patch looks good.

    @tiran
    Copy link
    Member Author

    tiran commented Dec 6, 2008

    The updated patch moves the compiler option to the right place.

    @rpetrov
    Copy link
    Mannequin

    rpetrov mannequin commented Dec 6, 2008

    There is no reason to overload configure script.

    Please look into pyport.h :
    #define Py_LOCAL(type) static type
    #define Py_LOCAL_INLINE(type) static inline type

    Someone add USE_INLINE - not finished.
    I guess that other source files has to use macros from one
    header(pyport.h) instead every C-file to resolve issue independently.

    @tiran
    Copy link
    Member Author

    tiran commented Dec 6, 2008

    I think you don't get the point of the patch. The configure option
    *enforces* the C89 standard. Every non C89 conform C feature like //
    comments and the "inline" keyword will cause a compiler error.

    The patch is meant for testing the Python code on the build bots.

    @rpetrov
    Copy link
    Mannequin

    rpetrov mannequin commented Dec 6, 2008

    Christian did you like to propose a separate configure flag for every
    dialect that GCC support? I prefer variables like OPT.

    @rpetrov
    Copy link
    Mannequin

    rpetrov mannequin commented Dec 6, 2008

    P.S. About C++ comments ( // ) I think that another issue is already
    opened (problem on AIX ? ) .

    @tiran
    Copy link
    Member Author

    tiran commented Dec 6, 2008

    Python core code must be compliant with the C89 standard but we don't
    have any checks for C89 compatibility. This patch adds a clean way to
    check our code base.

    You can verify my patch by adding a // comment somewhere in the code and
    ./configure --with-stdc89 && make.

    @rpetrov
    Copy link
    Mannequin

    rpetrov mannequin commented Dec 6, 2008

    make EXTRA_CFLAGS='-std=c89' works for me.

    @rpetrov
    Copy link
    Mannequin

    rpetrov mannequin commented Dec 7, 2008

    :-( the last my comment is incomplete : work for me after "minimal patch"

    @rpetrov
    Copy link
    Mannequin

    rpetrov mannequin commented Dec 8, 2008

    Socket module need to be patched too otherwise test_socket fail on UNIX
    domain socket tests.

    After clean build and with new patch the regression tests results are:
    337 tests OK.
    3 tests failed:
    test_curses test_urllib2_localnet test_urllibnet
    21 tests skipped:
    test_aepack test_al test_applesingle test_bsddb185 test_cd test_cl
    test_gl test_imgfile test_kqueue test_macos test_macostools
    test_pep277 test_py3kwarn test_scriptpackages test_sqlite
    test_startfile test_sunaudiodev test_unicode_file test_winreg
    test_winsound test_zipfile64
    Those skips are all expected on linux2.

    Interesting for failed tests is that every succeed if run independently.

    @rpetrov
    Copy link
    Mannequin

    rpetrov mannequin commented May 19, 2011

    Issue with inline was resolved by configure macro.

    @vstinner
    Copy link
    Member

    Is it still useful to ensure that ISO C89 compilers are supported in 2011?

    @amauryfa
    Copy link
    Member

    Yes, vs2008 requires that variables must be declared at the start of a block, and IIRC there is a AIX compiler that does not allow // comments.

    @tiran
    Copy link
    Member Author

    tiran commented Jun 24, 2013

    Updated patch for Python 3.4.

    The feature is still useful. For example I found a bug in pymacro.h and fixed it in r84306.

    @tiran tiran changed the title with_stdc89 ./configure --with-stdc89 to test ANSI C conformity Jun 24, 2013
    @tiran
    Copy link
    Member Author

    tiran commented Jun 24, 2013

    Make that r6915dfddb3f6

    @tiran tiran closed this as completed Sep 10, 2016
    @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 type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants