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

gh-113565: Improve and harden detection of curses dependencies #119816

Merged
merged 21 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
71a243d
gh-113565: Use pkg-config to detect ncurses[w] and panel[w]
erlend-aasland May 31, 2024
a036e9f
Pull in main
erlend-aasland May 31, 2024
a57e18d
Clean up pkg-config variables, fix manual check
erlend-aasland Jun 1, 2024
2965d4c
Pull in main
erlend-aasland Jun 1, 2024
de58647
Correctly choose includes in configure.ac and py_curses.h; use NCURSE…
erlend-aasland Jun 1, 2024
f874d3f
Add NEWS
erlend-aasland Jun 2, 2024
4eb1580
Simplify pkg-config checks and make sure we always do our header and …
erlend-aasland Jun 2, 2024
fb275e2
Disable curses/panel if not found; don't mark them as missing
erlend-aasland Jun 2, 2024
18b68c5
Enable panel only if curses is also found; harden term.h check, and c…
erlend-aasland Jun 2, 2024
6031b83
Pull in main
erlend-aasland Jun 2, 2024
bedd4b0
Use WITH_SAVE_ENV for all curses feature checks
erlend-aasland Jun 2, 2024
4990e46
Pull in main
erlend-aasland Jun 3, 2024
e61f55d
Fix pkg-config failure clause
erlend-aasland Jun 3, 2024
289058c
Mark curses/panel as missing iso. disabled if deps are not found
erlend-aasland Jun 3, 2024
739af74
Don't mess up compiler and linker flags; WITH_SAVE_ENV does not nest
erlend-aasland Jun 3, 2024
7edb576
AC_SEARCH_LIBS implicitly updates LIBS; no need for us to duplicate t…
erlend-aasland Jun 3, 2024
68336b7
Prioritise the *w libs in all checks and guards
erlend-aasland Jun 3, 2024
b5b8582
Pull in main
erlend-aasland Jun 3, 2024
311da9a
Guard panel includes
erlend-aasland Jun 3, 2024
26d2d0f
Pull in main
erlend-aasland Jun 3, 2024
487e0fd
Pull in main
erlend-aasland Jul 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Correctly choose includes in configure.ac and py_curses.h; use NCURSE…
…S_VERSION to guard ncurses features
  • Loading branch information
erlend-aasland committed Jun 1, 2024
commit de5864767e3a7b3afb47365b5baf2c3fda1a3818
18 changes: 13 additions & 5 deletions Include/py_curses.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,21 @@
#define NCURSES_OPAQUE 0
#endif

#ifdef HAVE_NCURSES_H
#include <ncurses.h>
#else
#include <curses.h>
#if defined(HAVE_NCURSESW_NCURSES_H)
# include <ncursesw/ncurses.h>
#elif defined(HAVE_NCURSESW_CURSES_H)
# include <ncursesw/curses.h>
#elif defined(HAVE_NCURSES_NCURSES_H)
# include <ncurses/ncurses.h>
#elif defined(HAVE_NCURSES_CURSES_H)
# include <ncurses/curses.h>
#elif defined(HAVE_NCURSES_H)
# include <ncurses.h>
#elif defined(HAVE_CURSES_H)
# include <curses.h>
#endif

#ifdef HAVE_NCURSES_H
#ifdef NCURSES_VERSION
/* configure was checking <curses.h>, but we will
use <ncurses.h>, which has some or all these features. */
#if !defined(WINDOW_HAS_FLAGS) && \
Expand All @@ -69,7 +77,7 @@

typedef struct {
PyObject_HEAD
WINDOW *win;

Check failure on line 80 in Include/py_curses.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

unknown type name ‘WINDOW’

Check failure on line 80 in Include/py_curses.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

unknown type name ‘WINDOW’

Check failure on line 80 in Include/py_curses.h

View workflow job for this annotation

GitHub Actions / Address sanitizer

unknown type name ‘WINDOW’

Check failure on line 80 in Include/py_curses.h

View workflow job for this annotation

GitHub Actions / Address sanitizer

unknown type name ‘WINDOW’

Check failure on line 80 in Include/py_curses.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

unknown type name ‘WINDOW’

Check failure on line 80 in Include/py_curses.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

unknown type name ‘WINDOW’

Check failure on line 80 in Include/py_curses.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

unknown type name ‘WINDOW’

Check failure on line 80 in Include/py_curses.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

unknown type name ‘WINDOW’

Check failure on line 80 in Include/py_curses.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

unknown type name ‘WINDOW’

Check failure on line 80 in Include/py_curses.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

unknown type name ‘WINDOW’

Check failure on line 80 in Include/py_curses.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

unknown type name ‘WINDOW’

Check failure on line 80 in Include/py_curses.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

unknown type name ‘WINDOW’

Check failure on line 80 in Include/py_curses.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

unknown type name ‘WINDOW’

Check failure on line 80 in Include/py_curses.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

unknown type name ‘WINDOW’

Check failure on line 80 in Include/py_curses.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

unknown type name ‘WINDOW’

Check failure on line 80 in Include/py_curses.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

unknown type name ‘WINDOW’
char *encoding;
} PyCursesWindowObject;

Expand Down
2 changes: 1 addition & 1 deletion Modules/_cursesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
#include <langinfo.h>
#endif

#if !defined(HAVE_NCURSES_H) && (defined(sgi) || defined(__sun) || defined(SCO5))
#if !defined(NCURSES_VERSION) && (defined(sgi) || defined(__sun) || defined(SCO5))
#define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
typedef chtype attr_t; /* No attr_t type is available */
#endif
Expand Down Expand Up @@ -170,7 +170,7 @@
static PyObject *PyCursesError;

/* Tells whether setupterm() has been called to initialise terminfo. */
static int initialised_setupterm = FALSE;

Check failure on line 173 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

‘FALSE’ undeclared here (not in a function)

Check failure on line 173 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

‘FALSE’ undeclared here (not in a function)

Check failure on line 173 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

‘FALSE’ undeclared here (not in a function)

Check failure on line 173 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

‘FALSE’ undeclared here (not in a function)

Check failure on line 173 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

‘FALSE’ undeclared here (not in a function)

Check failure on line 173 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

‘FALSE’ undeclared here (not in a function)

Check failure on line 173 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

‘FALSE’ undeclared here (not in a function)

Check failure on line 173 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

‘FALSE’ undeclared here (not in a function)

/* Tells whether initscr() has been called to initialise curses. */
static int initialised = FALSE;
Expand All @@ -182,13 +182,13 @@

/* Utility Macros */
#define PyCursesSetupTermCalled \
if (initialised_setupterm != TRUE) { \

Check failure on line 185 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

‘TRUE’ undeclared (first use in this function)

Check failure on line 185 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

‘TRUE’ undeclared (first use in this function)

Check failure on line 185 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

‘TRUE’ undeclared (first use in this function)

Check failure on line 185 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

‘TRUE’ undeclared (first use in this function)

Check failure on line 185 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

‘TRUE’ undeclared (first use in this function)

Check failure on line 185 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

‘TRUE’ undeclared (first use in this function)

Check failure on line 185 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

‘TRUE’ undeclared (first use in this function)

Check failure on line 185 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

‘TRUE’ undeclared (first use in this function)
PyErr_SetString(PyCursesError, \
"must call (at least) setupterm() first"); \
return 0; }

#define PyCursesInitialised \
if (initialised != TRUE) { \

Check failure on line 191 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

‘TRUE’ undeclared (first use in this function)

Check failure on line 191 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

‘TRUE’ undeclared (first use in this function)

Check failure on line 191 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

‘TRUE’ undeclared (first use in this function)

Check failure on line 191 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

‘TRUE’ undeclared (first use in this function)

Check failure on line 191 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

‘TRUE’ undeclared (first use in this function)

Check failure on line 191 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

‘TRUE’ undeclared (first use in this function)

Check failure on line 191 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

‘TRUE’ undeclared (first use in this function)

Check failure on line 191 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

‘TRUE’ undeclared (first use in this function)
PyErr_SetString(PyCursesError, \
"must call initscr() first"); \
return 0; }
Expand All @@ -210,7 +210,7 @@
static PyObject *
PyCursesCheckERR(int code, const char *fname)
{
if (code != ERR) {

Check failure on line 213 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

‘ERR’ undeclared (first use in this function); did you mean ‘ERA’?

Check failure on line 213 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

‘ERR’ undeclared (first use in this function); did you mean ‘ERA’?

Check failure on line 213 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

‘ERR’ undeclared (first use in this function); did you mean ‘ERA’?

Check failure on line 213 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

‘ERR’ undeclared (first use in this function); did you mean ‘ERA’?

Check failure on line 213 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

‘ERR’ undeclared (first use in this function); did you mean ‘ERA’?

Check failure on line 213 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

‘ERR’ undeclared (first use in this function); did you mean ‘ERA’?

Check failure on line 213 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

‘ERR’ undeclared (first use in this function); did you mean ‘ERA’?

Check failure on line 213 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

‘ERR’ undeclared (first use in this function); did you mean ‘ERA’?
Py_RETURN_NONE;
} else {
if (fname == NULL) {
Expand All @@ -230,7 +230,7 @@

Return 1 on success, 0 on error (invalid type or integer overflow). */
static int
PyCurses_ConvertToChtype(PyCursesWindowObject *win, PyObject *obj, chtype *ch)

Check failure on line 233 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

unknown type name ‘chtype’

Check failure on line 233 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

unknown type name ‘chtype’

Check failure on line 233 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

unknown type name ‘chtype’

Check failure on line 233 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

unknown type name ‘chtype’

Check failure on line 233 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

unknown type name ‘chtype’

Check failure on line 233 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

unknown type name ‘chtype’

Check failure on line 233 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

unknown type name ‘chtype’

Check failure on line 233 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

unknown type name ‘chtype’
{
long value;
if (PyBytes_Check(obj)) {
Expand Down Expand Up @@ -307,7 +307,7 @@
- 0 on error: raise an exception */
static int
PyCurses_ConvertToCchar_t(PyCursesWindowObject *win, PyObject *obj,
chtype *ch

Check failure on line 310 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

unknown type name ‘chtype’

Check failure on line 310 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

unknown type name ‘chtype’

Check failure on line 310 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

unknown type name ‘chtype’

Check failure on line 310 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

unknown type name ‘chtype’

Check failure on line 310 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

unknown type name ‘chtype’

Check failure on line 310 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

unknown type name ‘chtype’

Check failure on line 310 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

unknown type name ‘chtype’

Check failure on line 310 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

unknown type name ‘chtype’
#ifdef HAVE_NCURSESW
, wchar_t *wch
#endif
Expand Down Expand Up @@ -425,7 +425,7 @@
if (color_number == -1 && PyErr_Occurred())
return 0;

if (overflow > 0 || color_number >= COLORS) {

Check failure on line 428 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

‘COLORS’ undeclared (first use in this function)

Check failure on line 428 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

‘COLORS’ undeclared (first use in this function)

Check failure on line 428 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

‘COLORS’ undeclared (first use in this function)

Check failure on line 428 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

‘COLORS’ undeclared (first use in this function)

Check failure on line 428 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

‘COLORS’ undeclared (first use in this function)

Check failure on line 428 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

‘COLORS’ undeclared (first use in this function)

Check failure on line 428 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

‘COLORS’ undeclared (first use in this function)

Check failure on line 428 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

‘COLORS’ undeclared (first use in this function)
PyErr_Format(PyExc_ValueError,
"Color number is greater than COLORS-1 (%d).",
COLORS - 1);
Expand Down Expand Up @@ -485,7 +485,7 @@
return 0;
}
#else
if (overflow > 0 || pair_number >= COLOR_PAIRS) {

Check failure on line 488 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

‘COLOR_PAIRS’ undeclared (first use in this function)

Check failure on line 488 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

‘COLOR_PAIRS’ undeclared (first use in this function)

Check failure on line 488 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

‘COLOR_PAIRS’ undeclared (first use in this function)

Check failure on line 488 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

‘COLOR_PAIRS’ undeclared (first use in this function)

Check failure on line 488 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

‘COLOR_PAIRS’ undeclared (first use in this function)

Check failure on line 488 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

‘COLOR_PAIRS’ undeclared (first use in this function)

Check failure on line 488 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

‘COLOR_PAIRS’ undeclared (first use in this function)

Check failure on line 488 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

‘COLOR_PAIRS’ undeclared (first use in this function)
PyErr_Format(PyExc_ValueError,
"Color pair is greater than COLOR_PAIRS-1 (%d).",
COLOR_PAIRS - 1);
Expand Down Expand Up @@ -1315,14 +1315,14 @@
{
WINDOW *win;

win = derwin(self->win,nlines,ncols,begin_y,begin_x);

Check warning on line 1318 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 1318 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 1318 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 1318 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 1318 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 1318 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 1318 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 1318 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

if (win == NULL) {
PyErr_SetString(PyCursesError, catchall_NULL);
return NULL;
}

return (PyObject *)PyCursesWindow_New(win, NULL);

Check warning on line 1325 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

cast to pointer from integer of different size [-Wint-to-pointer-cast]

Check warning on line 1325 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

cast to pointer from integer of different size [-Wint-to-pointer-cast]

Check warning on line 1325 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

cast to pointer from integer of different size [-Wint-to-pointer-cast]

Check warning on line 1325 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

cast to pointer from integer of different size [-Wint-to-pointer-cast]

Check warning on line 1325 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

cast to pointer from integer of different size [-Wint-to-pointer-cast]

Check warning on line 1325 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

cast to pointer from integer of different size [-Wint-to-pointer-cast]

Check warning on line 1325 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

cast to pointer from integer of different size [-Wint-to-pointer-cast]

Check warning on line 1325 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

cast to pointer from integer of different size [-Wint-to-pointer-cast]
}

/*[clinic input]
Expand Down Expand Up @@ -1481,7 +1481,7 @@
#endif
return PyUnicode_FromOrdinal(rtn);
} else {
const char *knp = keyname(rtn);

Check warning on line 1484 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

initialization of ‘const char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 1484 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

initialization of ‘const char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 1484 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

initialization of ‘const char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 1484 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

initialization of ‘const char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 1484 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

initialization of ‘const char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 1484 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

initialization of ‘const char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 1484 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

initialization of ‘const char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 1484 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

initialization of ‘const char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
return PyUnicode_FromString((knp == NULL) ? "" : knp);
}
}
Expand Down Expand Up @@ -2342,14 +2342,14 @@
}
else
#endif
win = subwin(self->win, nlines, ncols, begin_y, begin_x);

Check warning on line 2345 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 2345 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 2345 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 2345 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 2345 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 2345 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 2345 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 2345 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

if (win == NULL) {
PyErr_SetString(PyCursesError, catchall_NULL);
return NULL;
}

return (PyObject *)PyCursesWindow_New(win, self->encoding);

Check warning on line 2352 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

cast to pointer from integer of different size [-Wint-to-pointer-cast]

Check warning on line 2352 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

cast to pointer from integer of different size [-Wint-to-pointer-cast]

Check warning on line 2352 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

cast to pointer from integer of different size [-Wint-to-pointer-cast]

Check warning on line 2352 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

cast to pointer from integer of different size [-Wint-to-pointer-cast]

Check warning on line 2352 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

cast to pointer from integer of different size [-Wint-to-pointer-cast]

Check warning on line 2352 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

cast to pointer from integer of different size [-Wint-to-pointer-cast]

Check warning on line 2352 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

cast to pointer from integer of different size [-Wint-to-pointer-cast]

Check warning on line 2352 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

cast to pointer from integer of different size [-Wint-to-pointer-cast]
}

/*[clinic input]
Expand Down Expand Up @@ -3092,12 +3092,12 @@
Py_DECREF(data);

fseek(fp, 0, 0);
win = getwin(fp);

Check warning on line 3095 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3095 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3095 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3095 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3095 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3095 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3095 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3095 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
if (win == NULL) {
PyErr_SetString(PyCursesError, catchall_NULL);
goto error;
}
res = PyCursesWindow_New(win, NULL);

Check warning on line 3100 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3100 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3100 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3100 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3100 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3100 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3100 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3100 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

error:
fclose(fp);
Expand Down Expand Up @@ -3273,7 +3273,7 @@
return (PyObject *)PyCursesWindow_New(stdscr, NULL);
}

win = initscr();

Check warning on line 3276 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3276 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3276 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3276 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3276 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3276 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3276 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

Check warning on line 3276 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]

if (win == NULL) {
PyErr_SetString(PyCursesError, catchall_NULL);
Expand Down
20 changes: 9 additions & 11 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6625,20 +6625,18 @@ dnl configuration.
AC_DEFUN([_CURSES_INCLUDES],dnl
[
#define NCURSES_OPAQUE 0
#ifdef HAVE_NCURSESW_CURSES_H
# include <ncursesw/curses.h>
#endif
#ifdef HAVE_NCURSESW_NCURSES_H
#if defined(HAVE_NCURSESW_NCURSES_H)
# include <ncursesw/ncurses.h>
#endif
#ifdef HAVE_NCURSES_CURSES_H
# include <ncurses/curses.h>
#endif
#ifdef HAVE_NCURSES_NCURSES_H
#elif defined(HAVE_NCURSESW_CURSES_H)
# include <ncursesw/curses.h>
#elif defined(HAVE_NCURSES_NCURSES_H)
# include <ncurses/ncurses.h>
#endif
#ifdef HAVE_NCURSES_H
#elif defined(HAVE_NCURSES_CURSES_H)
# include <ncurses/curses.h>
#elif defined(HAVE_NCURSES_H)
# include <ncurses.h>
#elif defined(HAVE_CURSES_H)
# include <curses.h>
#endif
])

Expand Down
Loading