Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Python 3.12.2 headers contain non-C90-compliant code #116869

Closed
Labels
@jayaddison

Description

@jayaddison

Bug report

Bug description:

When compiling a program that links against the Python libraries (and uses their headerfiles) with the-Werror=declaration-after-statement compiler flag enabled, the following error occurs:

/usr/include/python3.12/object.h:233:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]  233 |     PyVarObject *var_ob = _PyVarObject_CAST(ob);

This is fairly similar to previous issue#92781.

Although the C90 style may be archaic and perhaps not worth supporting at some point, maintaining support could be helpful for some downstream platforms (I encountered this in Debian bug#1057442).

Minimal test cases to show that the problem did not occur with Python 3.11.8 and that it does occur on Python 3.12.2 and to help verify any fixes.
#include"/usr/include/python3.11/Python.h"#include"/usr/include/python3.11/object.h"intmain() {}
#include"/usr/include/python3.12/Python.h"#include"/usr/include/python3.12/object.h"intmain() {}

Compiled in either case using:

$ gcc bugreport.c -Werror=declaration-after-statement

or equivalently, usingllvm v17:

$ clang-17 bugreport.c -Werror=declaration-after-statement

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp