Skip to content

Commit 2bd3469

Browse files
author
Tor Didriksen
committed
Bug#35599395 Change literal 0 to nullptr where appropriate [noclose windows]
Build with clang -Wzero-as-null-pointer-constant in Debug and RelWithDebInfo mode. The purpose was to clean up windows-only code. We also found issues with code used by all platforms, because we have: in /c/program files/llvm/lib/clang/16/include/stddef.h but on linux define NULL __null And the later did not trigger the warning in all cases. Change-Id: I41446b09a87b4986bed061d994b299717c87940b
1 parent 6f8a398 commit 2bd3469

File tree

154 files changed

+801
-766
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+801
-766
lines changed

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -2123,6 +2123,11 @@ INCLUDE(maintainer)
21232123
INCLUDE(msvc_cppcheck)
21242124
DO_MSVC_CPPCHECK()
21252125

2126+
IF(WIN32_CLANG AND CMAKE_BUILD_TYPE_UPPER STREQUAL "DEBUG")
2127+
# Not yet fixed for Debug code
2128+
STRING_APPEND(CMAKE_CXX_FLAGS " -Wno-format")
2129+
ENDIF()
2130+
21262131
IF(WITH_UNIT_TESTS)
21272132
ENABLE_TESTING()
21282133
INCLUDE(googletest)

client/base/abstract_program.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ my_option *Abstract_program::get_options_array() { return &this->m_options[0]; }
5353

5454
Abstract_program::Abstract_program()
5555
: m_debug_options(this), m_help_options(this) {
56-
this->add_providers(&this->m_help_options, &this->m_debug_options, NULL);
56+
this->add_providers(&this->m_help_options, &this->m_debug_options, nullptr);
5757
}
5858

5959
void Abstract_program::run(int argc, char **argv) {
@@ -97,7 +97,7 @@ void Abstract_program::init_name(char *name_from_cmd_line) {
9797
char *name;
9898

9999
char name_buf[FN_REFLEN];
100-
if (GetModuleFileName(NULL, name_buf, FN_REFLEN) != 0) {
100+
if (GetModuleFileName(nullptr, name_buf, FN_REFLEN) != 0) {
101101
name = name_buf;
102102
} else {
103103
name = name_from_cmd_line;

client/check/mysqlcheck.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static const char *opt_skip_database = "";
7575
static uint opt_zstd_compress_level = default_zstd_compression_level;
7676
static char *opt_compress_algorithm = nullptr;
7777
#if defined(_WIN32)
78-
static char *shared_memory_base_name = 0;
78+
static char *shared_memory_base_name = nullptr;
7979
#endif
8080
static uint opt_protocol = 0;
8181
static char *opt_bind_addr = nullptr;
@@ -187,8 +187,8 @@ static struct my_option my_long_options[] = {
187187
NO_ARG, 0, 0, 0, nullptr, 0, nullptr},
188188
#include "multi_factor_passwordopt-longopts.h"
189189
#ifdef _WIN32
190-
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
191-
NO_ARG, 0, 0, 0, 0, 0, 0},
190+
{"pipe", 'W', "Use named pipes to connect to server.", nullptr, nullptr,
191+
nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, nullptr},
192192
#endif
193193
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
194194
&opt_plugin_dir, &opt_plugin_dir, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0,
@@ -219,8 +219,8 @@ static struct my_option my_long_options[] = {
219219
#if defined(_WIN32)
220220
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
221221
"Base name of shared memory.", &shared_memory_base_name,
222-
&shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0,
223-
0},
222+
&shared_memory_base_name, nullptr, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0,
223+
nullptr, 0, nullptr},
224224
#endif
225225
{"silent", 's', "Print only error messages.", &opt_silent, &opt_silent,
226226
nullptr, GET_BOOL, NO_ARG, 0, 0, 0, nullptr, 0, nullptr},

client/dump/row_group_dump_task.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void Row_group_dump_task::set_completed() {
3232
for (std::vector<Row *>::iterator it = m_rows.begin(); it != m_rows.end();
3333
++it) {
3434
delete *it;
35-
*it = NULL;
35+
*it = nullptr;
3636
}
3737

3838
Abstract_simple_dump_task::set_completed();

client/mysql.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ static uint opt_zstd_compress_level = default_zstd_compression_level;
240240
static char *opt_compress_algorithm = nullptr;
241241

242242
#if defined(_WIN32)
243-
static char *shared_memory_base_name = 0;
243+
static char *shared_memory_base_name = nullptr;
244244
#endif
245245
static uint opt_protocol = 0;
246246
static const CHARSET_INFO *charset_info = &my_charset_latin1;
@@ -1914,8 +1914,8 @@ static struct my_option my_long_options[] = {
19141914
#endif
19151915
#include "multi_factor_passwordopt-longopts.h"
19161916
#ifdef _WIN32
1917-
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
1918-
NO_ARG, 0, 0, 0, 0, 0, 0},
1917+
{"pipe", 'W', "Use named pipes to connect to server.", nullptr, nullptr,
1918+
nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, nullptr},
19191919
#endif
19201920
{"port", 'P',
19211921
"Port number to use for connection or 0 for default to, in "
@@ -1952,8 +1952,8 @@ static struct my_option my_long_options[] = {
19521952
#if defined(_WIN32)
19531953
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
19541954
"Base name of shared memory.", &shared_memory_base_name,
1955-
&shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0,
1956-
0},
1955+
&shared_memory_base_name, nullptr, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0,
1956+
nullptr, 0, nullptr},
19571957
#endif
19581958
{"socket", 'S', "The socket file to use for connection.",
19591959
&opt_mysql_unix_port, &opt_mysql_unix_port, nullptr, GET_STR_ALLOC,

client/mysql_secure_installation.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ static struct my_option my_connection_options[] = {
8080
nullptr, nullptr, nullptr, GET_PASSWORD, OPT_ARG, 0, 0, 0, nullptr, 0,
8181
nullptr},
8282
#ifdef _WIN32
83-
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
84-
NO_ARG, 0, 0, 0, 0, 0, 0},
83+
{"pipe", 'W', "Use named pipes to connect to server.", nullptr, nullptr,
84+
nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, nullptr},
8585
#endif
8686
{"port", 'P',
8787
"Port number to use for connection or 0 for default to, in "
@@ -98,8 +98,8 @@ static struct my_option my_connection_options[] = {
9898
#if defined(_WIN32)
9999
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
100100
"Base name of shared memory.", &shared_memory_base_name,
101-
&shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0,
102-
0},
101+
&shared_memory_base_name, nullptr, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0,
102+
nullptr, 0, nullptr},
103103
#endif
104104
{"socket", 'S', "Socket file to be used for connection.", &opt_socket,
105105
&opt_socket, nullptr, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, nullptr, 0,

client/mysqladmin.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static bool opt_show_warnings = false;
8383
static uint opt_zstd_compress_level = default_zstd_compression_level;
8484
static char *opt_compress_algorithm = nullptr;
8585
#if defined(_WIN32)
86-
static char *shared_memory_base_name = 0;
86+
static char *shared_memory_base_name = nullptr;
8787
#endif
8888
static uint opt_protocol = 0;
8989
static myf error_flags; /* flags to pass to my_printf_error, like ME_BELL */
@@ -236,8 +236,8 @@ static struct my_option my_long_options[] = {
236236
nullptr, GET_BOOL, NO_ARG, 0, 0, 0, nullptr, 0, nullptr},
237237
#include "multi_factor_passwordopt-longopts.h"
238238
#ifdef _WIN32
239-
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
240-
NO_ARG, 0, 0, 0, 0, 0, 0},
239+
{"pipe", 'W', "Use named pipes to connect to server.", nullptr, nullptr,
240+
nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, nullptr},
241241
#endif
242242
{"port", 'P',
243243
"Port number to use for connection or 0 for default to, in "
@@ -259,8 +259,8 @@ static struct my_option my_long_options[] = {
259259
#if defined(_WIN32)
260260
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
261261
"Base name of shared memory.", &shared_memory_base_name,
262-
&shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0,
263-
0},
262+
&shared_memory_base_name, nullptr, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0,
263+
nullptr, 0, nullptr},
264264
#endif
265265
{"silent", 's', "Silently exit if one can't connect to server.", nullptr,
266266
nullptr, nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, nullptr},

client/mysqlbinlog.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1949,7 +1949,8 @@ static struct my_option my_long_options[] = {
19491949
#if defined(_WIN32)
19501950
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
19511951
"Base name of shared memory.", &shared_memory_base_name,
1952-
&shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1952+
&shared_memory_base_name, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr,
1953+
0, nullptr},
19531954
#endif
19541955
{"short-form", 's',
19551956
"Just show regular queries: no extra info and no "

client/mysqldump.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static enum enum_set_gtid_purged_mode {
193193
} opt_set_gtid_purged_mode = SET_GTID_PURGED_AUTO;
194194

195195
#if defined(_WIN32)
196-
static char *shared_memory_base_name = 0;
196+
static char *shared_memory_base_name = nullptr;
197197
#endif
198198
static uint opt_protocol = 0;
199199
static char *opt_plugin_dir = nullptr, *opt_default_auth = nullptr;
@@ -524,8 +524,8 @@ static struct my_option my_long_options[] = {
524524
0, 0, nullptr, 0, nullptr},
525525
#include "multi_factor_passwordopt-longopts.h"
526526
#ifdef _WIN32
527-
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, nullptr,
528-
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
527+
{"pipe", 'W', "Use named pipes to connect to server.", nullptr, nullptr,
528+
nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, nullptr},
529529
#endif
530530
{"port", 'P', "Port number to use for connection.", &opt_mysql_port,
531531
&opt_mysql_port, nullptr, GET_UINT, REQUIRED_ARG, 0, 0, 0, nullptr, 0,
@@ -568,8 +568,8 @@ static struct my_option my_long_options[] = {
568568
#if defined(_WIN32)
569569
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
570570
"Base name of shared memory.", &shared_memory_base_name,
571-
&shared_memory_base_name, nullptr, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
572-
0, 0},
571+
&shared_memory_base_name, nullptr, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0,
572+
nullptr, 0, nullptr},
573573
#endif
574574
/*
575575
Note that the combination --single-transaction --master-data

client/mysqlimport.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static char *opt_compress_algorithm = nullptr;
8989
#include "multi_factor_passwordopt-vars.h"
9090
#include "sslopt-vars.h"
9191
#if defined(_WIN32)
92-
static char *shared_memory_base_name = 0;
92+
static char *shared_memory_base_name = nullptr;
9393
#endif
9494

9595
static struct my_option my_long_options[] = {
@@ -182,8 +182,8 @@ static struct my_option my_long_options[] = {
182182
nullptr},
183183
#include "multi_factor_passwordopt-longopts.h"
184184
#ifdef _WIN32
185-
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
186-
NO_ARG, 0, 0, 0, 0, 0, 0},
185+
{"pipe", 'W', "Use named pipes to connect to server.", nullptr, nullptr,
186+
nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, nullptr},
187187
#endif
188188
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
189189
&opt_plugin_dir, &opt_plugin_dir, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0,
@@ -206,8 +206,8 @@ static struct my_option my_long_options[] = {
206206
#if defined(_WIN32)
207207
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
208208
"Base name of shared memory.", &shared_memory_base_name,
209-
&shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0,
210-
0},
209+
&shared_memory_base_name, nullptr, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0,
210+
nullptr, 0, nullptr},
211211
#endif
212212
{"silent", 's', "Be more silent.", &silent, &silent, nullptr, GET_BOOL,
213213
NO_ARG, 0, 0, 0, nullptr, 0, nullptr},

client/mysqlshow.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static char *opt_compress_algorithm = nullptr;
6969
#include "multi_factor_passwordopt-vars.h"
7070

7171
#if defined(_WIN32)
72-
static char *shared_memory_base_name = 0;
72+
static char *shared_memory_base_name = nullptr;
7373
#endif
7474
static uint opt_protocol = 0;
7575
static char *opt_bind_addr = nullptr;
@@ -279,17 +279,17 @@ static struct my_option my_long_options[] = {
279279
&opt_mysql_port, &opt_mysql_port, nullptr, GET_UINT, REQUIRED_ARG, 0, 0, 0,
280280
nullptr, 0, nullptr},
281281
#ifdef _WIN32
282-
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
283-
NO_ARG, 0, 0, 0, 0, 0, 0},
282+
{"pipe", 'W', "Use named pipes to connect to server.", nullptr, nullptr,
283+
nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, nullptr},
284284
#endif
285285
{"protocol", OPT_MYSQL_PROTOCOL,
286286
"The protocol to use for connection (tcp, socket, pipe, memory).", nullptr,
287287
nullptr, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0, nullptr, 0, nullptr},
288288
#if defined(_WIN32)
289289
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
290290
"Base name of shared memory.", &shared_memory_base_name,
291-
&shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0,
292-
0},
291+
&shared_memory_base_name, nullptr, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0,
292+
nullptr, 0, nullptr},
293293
#endif
294294
{"show-table-type", 't', "Show table type column.", &opt_table_type,
295295
&opt_table_type, nullptr, GET_BOOL, NO_ARG, 0, 0, 0, nullptr, 0, nullptr},

client/mysqlslap.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ database, then reporting the timing of each stage.
132132
#endif
133133

134134
#if defined(_WIN32)
135-
static char *shared_memory_base_name = 0;
135+
static char *shared_memory_base_name = nullptr;
136136
#endif
137137

138138
/* Global Thread counter */
@@ -670,8 +670,8 @@ static struct my_option my_long_options[] = {
670670
nullptr, 0, nullptr},
671671
#include "multi_factor_passwordopt-longopts.h"
672672
#ifdef _WIN32
673-
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
674-
NO_ARG, 0, 0, 0, 0, 0, 0},
673+
{"pipe", 'W', "Use named pipes to connect to server.", nullptr, nullptr,
674+
nullptr, GET_NO_ARG, NO_ARG, 0, 0, 0, nullptr, 0, nullptr},
675675
#endif
676676
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
677677
&opt_plugin_dir, &opt_plugin_dir, nullptr, GET_STR, REQUIRED_ARG, 0, 0, 0,
@@ -704,8 +704,8 @@ static struct my_option my_long_options[] = {
704704
#if defined(_WIN32)
705705
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
706706
"Base name of shared memory.", &shared_memory_base_name,
707-
&shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0,
708-
0},
707+
&shared_memory_base_name, nullptr, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0,
708+
nullptr, 0, nullptr},
709709
#endif
710710
{"silent", 's', "Run program in silent mode - no output.", &opt_silent,
711711
&opt_silent, nullptr, GET_BOOL, NO_ARG, 0, 0, 0, nullptr, 0, nullptr},

client/mysqltest.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -2015,7 +2015,7 @@ static bool show_diff(DYNAMIC_STRING *ds, const char *filename1,
20152015
else if (diff_check("mtrdiff"))
20162016
diff_name = "mtrdiff";
20172017
else
2018-
diff_name = 0;
2018+
diff_name = nullptr;
20192019
#else
20202020
// Otherwise always assume it's called diff
20212021
diff_name = "diff";
@@ -7808,8 +7808,8 @@ static struct my_option my_long_options[] = {
78087808
nullptr, 0, nullptr},
78097809
#ifdef _WIN32
78107810
{"safe-process-pid", OPT_SAFEPROCESS_PID, "PID of safeprocess.",
7811-
&opt_safe_process_pid, &opt_safe_process_pid, 0, GET_INT, REQUIRED_ARG, 0,
7812-
0, 0, 0, 0, 0},
7811+
&opt_safe_process_pid, &opt_safe_process_pid, nullptr, GET_INT,
7812+
REQUIRED_ARG, 0, 0, 0, nullptr, 0, nullptr},
78137813
#endif
78147814
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
78157815
"Base name of shared memory.", &shared_memory_base_name,
@@ -8136,7 +8136,7 @@ void init_win_path_patterns() {
81368136
for (i = 0; i < num_paths; i++) {
81378137
VAR *v;
81388138
if (*(paths[i]) == '$') {
8139-
v = var_get(paths[i], 0, 0, 0);
8139+
v = var_get(paths[i], nullptr, 0, 0);
81408140
p = my_strdup(PSI_NOT_INSTRUMENTED, v->str_val, MYF(MY_FAE));
81418141
} else
81428142
p = my_strdup(PSI_NOT_INSTRUMENTED, paths[i], MYF(MY_FAE));

components/libminchassis/dynamic_loader_scheme_file_imp.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
3333

3434
#if defined(_WIN32)
3535
#define dlsym(lib, name) (void *)GetProcAddress((HMODULE)lib, name)
36-
#define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0)
36+
#define dlopen(libname, unused) LoadLibraryEx(libname, nullptr, 0)
3737
#define dlclose(lib) FreeLibrary((HMODULE)lib)
3838
#define RTLD_NOW 0x00002
39-
#define DLERROR_GENERATE(errmsg, error_number) \
40-
char win_errormsg[2048]; \
41-
if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, error_number, 0, \
42-
win_errormsg, 2048, NULL)) { \
43-
char *ptr; \
44-
for (ptr = &win_errormsg[0] + strlen(win_errormsg) - 1; \
45-
ptr >= &win_errormsg[0] && strchr("\r\n\t\0x20", *ptr); ptr--) \
46-
*ptr = 0; \
47-
errmsg = win_errormsg; \
48-
} else \
39+
#define DLERROR_GENERATE(errmsg, error_number) \
40+
char win_errormsg[2048]; \
41+
if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, error_number, 0, \
42+
win_errormsg, 2048, nullptr)) { \
43+
char *ptr; \
44+
for (ptr = &win_errormsg[0] + strlen(win_errormsg) - 1; \
45+
ptr >= &win_errormsg[0] && strchr("\r\n\t\0x20", *ptr); ptr--) \
46+
*ptr = 0; \
47+
errmsg = win_errormsg; \
48+
} else \
4949
errmsg = ""
5050
#define dlerror() ""
5151
#define dlopen_errno GetLastError()

extra/icu/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ ENDIF()
6464

6565
MY_CHECK_CXX_COMPILER_WARNING("-Wzero-as-null-pointer-constant" HAS_WARN_FLAG)
6666
IF(HAS_WARN_FLAG)
67+
# For WIN32_CLANG, replace it, since we do not use ICU_LINUX_COMPILE_OPTIONS.
68+
STRING(REPLACE "-Wzero-as-null-pointer-constant" ""
69+
CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
6770
LIST(APPEND ICU_LINUX_COMPILE_OPTIONS "${HAS_WARN_FLAG}")
6871
ENDIF()
6972

extra/protobuf/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ ENDIF()
4545

4646
MY_CHECK_CXX_COMPILER_WARNING("-Wzero-as-null-pointer-constant" HAS_WARN_FLAG)
4747
IF(HAS_WARN_FLAG)
48+
# For WIN32_CLANG, replace it, since we do not use ICU_LINUX_COMPILE_OPTIONS.
49+
STRING(REPLACE "-Wzero-as-null-pointer-constant" ""
50+
CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
4851
LIST(APPEND ICU_LINUX_COMPILE_OPTIONS "${HAS_WARN_FLAG}")
4952
ENDIF()
5053

include/dh_ecdh_config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ bool set_dh(SSL_CTX *ctx) {
240240
return true;
241241
};
242242

243-
pctx = EVP_PKEY_CTX_new_from_name(NULL, "DH", NULL);
243+
pctx = EVP_PKEY_CTX_new_from_name(nullptr, "DH", nullptr);
244244
params[0] = OSSL_PARAM_construct_utf8_string(
245245
"group", const_cast<char *>(rfc7919_primes[prime_index]), 0);
246246
params[1] = OSSL_PARAM_construct_end();

0 commit comments

Comments
 (0)