8000 Fix compiler warnings for PyBytesWriter_Format (#152) · amolenaar/pythoncapi-compat@97f1582 · GitHub
[go: up one dir, main page]

Skip to content

Commit 97f1582

Browse files
authored
Fix compiler warnings for PyBytesWriter_Format (python#152)
1 parent c3c63ee commit 97f1582

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

pythoncapi_compat.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2529,6 +2529,10 @@ PyBytesWriter_WriteBytes(PyBytesWriter *writer,
25292529
return 0;
25302530
}
25312531

2532+
static inline int
2533+
PyBytesWriter_Format(PyBytesWriter *writer, const char *format, ...)
2534+
Py_GCC_ATTRIBUTE((format(printf, 2, 0)));
2535+
25322536
static inline int
25332537
PyBytesWriter_Format(PyBytesWriter *writer, const char *format, ...)
25342538
{

tests/setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@
3434
'-Wconversion',
3535
# /usr/lib64/pypy3.7/include/pyport.h:68:20: error: redefinition of typedef
3636
# 'Py_hash_t' is a C11 feature
37-
"-Wno-typedef-redefinition",
37+
'-Wno-typedef-redefinition',
38+
# Formatting checks
39+
'-Wformat',
40+
'-Wformat-nonliteral',
41+
'-Wformat-security',
3842
))
3943
CFLAGS = COMMON_FLAGS + [
4044
# Use C99 for pythoncapi_compat.c which initializes PyModuleDef with a

0 commit comments

Comments
 (0)
0