Skip to content

Commit 81686e7

Browse files
miss-islingtontiran
andauthoredJun 20, 2022
gh-84461: Silence some compiler warnings on WASM (GH-93978)
(cherry picked from commit 774ef28) Co-authored-by: Christian Heimes <christian@python.org>
1 parent 5abe4cb commit 81686e7

File tree

7 files changed

+12
-8
lines changed

7 files changed

+12
-8
lines changed
 

‎Modules/_io/bufferedio.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ _enter_buffered_busy(buffered *self)
328328
: buffered_closed(self)))
329329

330330
#define CHECK_CLOSED(self, error_msg) \
331-
if (IS_CLOSED(self) & (Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t) == 0)) { \
331+
if (IS_CLOSED(self) && (Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t) == 0)) { \
332332
PyErr_SetString(PyExc_ValueError, error_msg); \
333333
return NULL; \
334334
} \

‎Modules/getnameinfo.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
104104
u_long v4a;
105105
#ifdef ENABLE_IPV6
106106
u_char pfx;
107-
#endif
108107
int h_error;
108+
#endif
109109
char numserv[512];
110110
char numaddr[512];
111111

@@ -181,7 +181,6 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
181181
hp = getipnodebyaddr(addr, gni_afd->a_addrlen, gni_afd->a_af, &h_error);
182182
#else
183183
hp = gethostbyaddr(addr, gni_afd->a_addrlen, gni_afd->a_af);
184-
h_error = h_errno;
185184
#endif
186185

187186
if (hp) {

‎Modules/signalmodule.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ compare_handler(PyObject *func, PyObject *dfl_ign_handler)
189189
return PyObject_RichCompareBool(func, dfl_ign_handler, Py_EQ) == 1;
190190
}
191191

192-
#ifdef HAVE_GETITIMER
193-
/* auxiliary functions for setitimer */
192+
#ifdef HAVE_SETITIMER
193+
/* auxiliary function for setitimer */
194194
static int
195195
timeval_from_double(PyObject *obj, struct timeval *tv)
196196
{
@@ -206,7 +206,10 @@ timeval_from_double(PyObject *obj, struct timeval *tv)
206206
}
207207
return _PyTime_AsTimeval(t, tv, _PyTime_ROUND_CEILING);
208208
}
209+
#endif
209210

211+
#if defined(HAVE_SETITIMER) || defined(HAVE_GETITIMER)
212+
/* auxiliary functions for get/setitimer */
210213
Py_LOCAL_INLINE(double)
211214
double_from_timeval(struct timeval *tv)
212215
{

‎Modules/socketmodule.c

+2
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,7 @@ init_sockobject(PySocketSockObject *s,
10131013
}
10141014

10151015

1016+
#ifdef HAVE_SOCKETPAIR
10161017
/* Create a new socket object.
10171018
This just creates the object and initializes it.
10181019
If the creation fails, return NULL and set an exception (implicit
@@ -1032,6 +1033,7 @@ new_sockobject(SOCKET_T fd, int family, int type, int proto)
10321033
}
10331034
return s;
10341035
}
1036+
#endif
10351037

10361038

10371039
/* Lock to allow python interpreter to continue, but only allow one

‎Objects/stringlib/fastsearch.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ STRINGLIB(_preprocess)(const STRINGLIB_CHAR *needle, Py_ssize_t len_needle,
345345
}
346346
// Fill up a compressed Boyer-Moore "Bad Character" table
347347
Py_ssize_t not_found_shift = Py_MIN(len_needle, MAX_SHIFT);
348-
for (Py_ssize_t i = 0; i < TABLE_SIZE; i++) {
348+
for (Py_ssize_t i = 0; i < (Py_ssize_t)TABLE_SIZE; i++) {
349349
p->table[i] = Py_SAFE_DOWNCAST(not_found_shift,
350350
Py_ssize_t, SHIFT_TYPE);
351351
}

‎configure

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -6977,7 +6977,7 @@ PY_STDLIB_MOD([_testbuffer], [test "$TEST_MODULES" = yes])
69776977
PY_STDLIB_MOD([_testimportmultiple], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes])
69786978
PY_STDLIB_MOD([_testmultiphase], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes])
69796979
PY_STDLIB_MOD([_xxtestfuzz], [test "$TEST_MODULES" = yes])
6980-
PY_STDLIB_MOD([_ctypes_test], [test "$TEST_MODULES" = yes], [], [], [-lm])
6980+
PY_STDLIB_MOD([_ctypes_test], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes], [], [-lm])
69816981

69826982
dnl Limited API template modules.
69836983
dnl The limited C API is not compatible with the Py_TRACE_REFS macro.

0 commit comments

Comments
 (0)
Please sign in to comment.