在 2025-5-4 22:24, наб 写道:
Consider the following program, reduced from Lensfun: #include <cstring> extern char *f(const char *first_element, ...) __attribute__((__sentinel__)); static auto N = f("a", "b", NULL); static auto n = f("a", "b", nullptr); static auto z = f("a", "b", 0); #define NULL 123 in C++11 and later, NULL=nullptr so N/n are valid, and z is wrong.
In C++ it's common to have `NULL` defined as `0`. Your code should not assume `NULL` is an expression whose size is a pointer.
-- Best regards, LIU Hao
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public