Skip to content

setenv/unsetenv errors on HP-UX during compilation #91965

Closed
@narender-n

Description

@narender-n

Trying to cross compile python3.10.4 on a Linux machine with gcc-9.3.0 for HP-UX IA64 and running into following errors. Did not find the setenv/unsetenv in stdlib.h for HP-UX.

*Python/pylifecycle.c: In function '_coerce_default_locale_settings':
Python/pylifecycle.c:319:9: error: implicit declaration of function 'setenv'; did you mean 'getenv'? [-Werror=implicit-function-declaration]
  319 |     if (setenv("LC_CTYPE", newloc, 1)) {
      |         ^~~~~~
      |         getenv
cc1: some warnings being treated as errors
./Modules/posixmodule.c: In function 'os_putenv_impl':
./Modules/posixmodule.c:10969:9: error: implicit declaration of function 'setenv'; did you mean 'getenv'? [-Werror=implicit-function-declaration]
10969 |     if (setenv(name_string, value_string, 1)) {
      |         ^~~~~~
      |         getenv
./Modules/posixmodule.c: In function 'os_unsetenv_impl':
./Modules/posixmodule.c:11014:15: error: implicit declaration of function 'unsetenv'; did you mean 'getenv'? [-Werror=implicit-function-declaration]
11014 |     int err = unsetenv(PyBytes_AS_STRING(name));
      |               ^~~~~~~~
      |               getenv*

Looks like this is implemented in 3.9 and does not have any config to skip this. Need help addressing this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions