Skip to content

Check EX_OK is defined before including sysexits.h means it is always redefined #129539

Closed
@collinfunk

Description

@collinfunk

Bug report

Bug description:

Minor nit, but there is a check for the definition of EX_OK before sysexits.h is included. Meaning it is always redefined when that header exists.

 In file included from ./Modules/posixmodule.c:295: /usr/include/sysexits.h:92:9: warning: "EX_OK" redefined 92 | #define EX_OK 0 /* successful termination */ | ^~~~~ ./Modules/posixmodule.c:56:11: note: this is the location of the previous definition 56 | # define EX_OK EXIT_SUCCESS | ^~~~~ 

The C standard says redefinition's like this aren't allowed, but in practice I've only seen compilers warn about them.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions