gh-133256: Add _Py_NONSTRING macro (#133257)

Fix GCC 15 compiler warnings such as:

    Modules/fcntlmodule.c:27:36: warning: initializer-string for
    array of 'char' truncates NUL terminator but destination lacks
    'nonstring' attribute (9 chars into 8 available)
    [-Wunterminated-string-initialization]
    static const char guard[GUARDSZ] = "\x00\xfa\x69\xc4\x67\xa3\x6c\x58";
This commit is contained in:
Victor Stinner 2025-05-01 17:55:49 +02:00 committed by GitHub
parent ad2f0884b1
commit e26bafd107
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 2 deletions

View file

@ -24,7 +24,7 @@
#define GUARDSZ 8
// NUL followed by random bytes.
static const char guard[GUARDSZ] = "\x00\xfa\x69\xc4\x67\xa3\x6c\x58";
static const char guard[GUARDSZ] _Py_NONSTRING = "\x00\xfa\x69\xc4\x67\xa3\x6c\x58";
/*[clinic input]
module fcntl