Changeset: 4020c8d1ee9a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4020c8d1ee9a
Modified Files:
CMakeLists.txt
clients/odbc/CMakeLists.txt
common/utils/mcrypt.h
common/utils/msabaoth.h
common/utils/muuid.h
monetdb_config.h.in
testing/difflib.c
testing/testing_getopt.c
tools/merovingian/utils/control.h
tools/merovingian/utils/database.h
tools/merovingian/utils/glob.h
tools/merovingian/utils/properties.h
tools/merovingian/utils/utils.h
Branch: cmake-fun
Log Message:
Attempting to fix strict compilation with clang 9 on Windows.
Still throws many warnings, but some of them are compiler bugs. I won't go
further for now, maybe in the future if someone requests it.
diffs (truncated from 481 to 300 lines):
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -698,8 +698,6 @@ if(${ENABLE_STRICT} STREQUAL "YES")
MT_checkCompilerFlag("-Wpointer-arith")
MT_checkCompilerFlag("-Wundef")
MT_checkCompilerFlag("-Wformat=2")
- MT_checkCompilerFlag("-Wformat-overflow=1")
- MT_checkCompilerFlag("-Wno-format-truncation")
MT_checkCompilerFlag("-Wno-format-nonliteral")
MT_checkCompilerFlag("-Winit-self")
MT_checkCompilerFlag("-Winvalid-pch")
@@ -710,18 +708,21 @@ if(${ENABLE_STRICT} STREQUAL "YES")
MT_checkCompilerFlag("-Wpacked")
MT_checkCompilerFlag("-Wunknown-pragmas")
MT_checkCompilerFlag("-Wvariadic-macros")
+ MT_checkCompilerFlag("-Wstack-protector")
+ MT_checkCompilerFlag("-Wmissing-include-dirs")
+ MT_checkCompilerFlag("-Wnested-externs")
+ MT_checkCompilerFlag("-Wunreachable-code")
+ # Clang 9.0 on Windows doesn't have the following parameters, I
have to see why the test still passes
MT_checkCompilerFlag("-fstack-protector-all")
- MT_checkCompilerFlag("-Wstack-protector")
+ MT_checkCompilerFlag("-Wformat-overflow=1")
+ MT_checkCompilerFlag("-Wno-format-truncation")
MT_checkCompilerFlag("-Wpacked-bitfield-compat")
MT_checkCompilerFlag("-Wsync-nand")
MT_checkCompilerFlag("-Wjump-misses-init")
- MT_checkCompilerFlag("-Wmissing-include-dirs")
MT_checkCompilerFlag("-Wlogical-op")
MT_checkCompilerFlag("-Wduplicated-cond")
MT_checkCompilerFlag("-Wduplicated-branches")
MT_checkCompilerFlag("-Wrestrict")
- MT_checkCompilerFlag("-Wnested-externs")
- MT_checkCompilerFlag("-Wunreachable-code")
elseif(${CMAKE_C_COMPILER_ID} STREQUAL "Intel")
MT_addCompilerFlag("${COMPILER_OPTION}Wall"
"${COMPILER_OPTION}Wall" "${CMAKE_C_FLAGS}" "all" CMAKE_C_FLAGS)
MT_addCompilerFlag("${COMPILER_OPTION}Wcheck"
"${COMPILER_OPTION}Wcheck" "${CMAKE_C_FLAGS}" "all" CMAKE_C_FLAGS)
diff --git a/clients/odbc/CMakeLists.txt b/clients/odbc/CMakeLists.txt
--- a/clients/odbc/CMakeLists.txt
+++ b/clients/odbc/CMakeLists.txt
@@ -18,7 +18,7 @@ if(NOT ${ENABLE_ODBC} STREQUAL "NO")
cmake_push_check_state()
set(CMAKE_REQUIRED_INCLUDES
"${CMAKE_REQUIRED_INCLUDES};${ODBC_INCLUDE_DIR}")
if(WIN32)
- set(CMAKE_EXTRA_INCLUDE_FILES
"${CMAKE_EXTRA_INCLUDE_FILES};windows.h;sqlext.h;sqltypes.h")
+ set(CMAKE_EXTRA_INCLUDE_FILES
"${CMAKE_EXTRA_INCLUDE_FILES};Windows.h;sqlext.h;sqltypes.h")
else()
set(CMAKE_EXTRA_INCLUDE_FILES
"${CMAKE_EXTRA_INCLUDE_FILES};sql.h;sqltypes.h")
endif()
diff --git a/common/utils/mcrypt.h b/common/utils/mcrypt.h
--- a/common/utils/mcrypt.h
+++ b/common/utils/mcrypt.h
@@ -6,8 +6,8 @@
* Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
*/
-#ifndef _SEEN_MCRYPT_H
-#define _SEEN_MCRYPT_H 1
+#ifndef MT_SEEN_MCRYPT_H
+#define MT_SEEN_MCRYPT_H 1
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
#if !defined(LIBMAPI) && !defined(LIBMCRYPT)
diff --git a/common/utils/msabaoth.h b/common/utils/msabaoth.h
--- a/common/utils/msabaoth.h
+++ b/common/utils/msabaoth.h
@@ -6,8 +6,8 @@
* Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
*/
-#ifndef _SEEN_SABAOTH_H
-#define _SEEN_SABAOTH_H 1
+#ifndef MT_SEEN_SABAOTH_H
+#define MT_SEEN_SABAOTH_H 1
#include <time.h> /* for time_t */
diff --git a/common/utils/muuid.h b/common/utils/muuid.h
--- a/common/utils/muuid.h
+++ b/common/utils/muuid.h
@@ -6,8 +6,8 @@
* Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
*/
-#ifndef _SEEN_MUUID_H
-#define _SEEN_MUUID_H 1
+#ifndef MT_SEEN_MUUID_H
+#define MT_SEEN_MUUID_H 1
/* this function is (currently) only used in msabaoth and sql;
* msabaoth is part of monetdb5 and we want this function to be
diff --git a/monetdb_config.h.in b/monetdb_config.h.in
--- a/monetdb_config.h.in
+++ b/monetdb_config.h.in
@@ -7,8 +7,8 @@
*/
/* monetdb_config.h.in. Generated from CMakeLists.txt */
-#ifndef _SEEN_MONETDB_CONFIG_H
-#define _SEEN_MONETDB_CONFIG_H 1
+#ifndef MT_SEEN_MONETDB_CONFIG_H
+#define MT_SEEN_MONETDB_CONFIG_H 1
/* Number of bits in a file offset, on hosts where this is settable.
Make sure this macro is set before any header files. */
@@ -81,7 +81,7 @@
#include <crtdbg.h>
#endif
-#include <windows.h>
+#include <Windows.h>
#endif /* _MSC_VER */
/* location where binaries are installed */
@@ -410,4 +410,4 @@ stpcpy(char *restrict dst, const char *r
#define PROMPT2 "\001\002\n" /* prompt: more data needed */
#define PROMPT3 "\001\003\n" /* prompt: get file content */
-#endif /* _SEEN_MONETDB_CONFIG_H */
+#endif /* MT_SEEN_MONETDB_CONFIG_H */
diff --git a/testing/difflib.c b/testing/difflib.c
--- a/testing/difflib.c
+++ b/testing/difflib.c
@@ -416,10 +416,8 @@ oldnew2lwc_diff(int mindiff, int LWC, in
return oldnew2w_diff(mindiff, context, ignore, function,
old_fn, new_fn, lwc_diff_fn);
case 2:
return oldnew2c_diff(mindiff, context, ignore, function,
old_fn, new_fn, lwc_diff_fn);
- default:
- ErrXit("oldnew2lwc_diff called with wrong LWC", "", 1);
}
- return 0;
+ ErrXit("oldnew2lwc_diff called with wrong LWC", "", 1);
}
/* oldnew2lwc_diff */
@@ -564,29 +562,29 @@ lwc_diff2html(char *old_fn, char *new_fn
if (line[0] == ' ') {
if (newline && (nrn < orn)) {
while (nrn < orn) {
- SETBLUE(1, minor);
+ SETBLUE(1, minor)
fprintf(clmn_fp[1],
"%i", oln++);
- SETBLACK(1);
+ SETBLACK(1)
fprintf(clmn_fp[1],
"\n");
- SETBLUE(2, minor);
+ SETBLUE(2, minor)
fprintf(clmn_fp[2],
"-");
- SETBLACK(2);
+ SETBLACK(2)
fprintf(clmn_fp[2],
"\n");
fprintf(clmn_fp[3],
"\n");
fprintf(clmn_fp[4],
"\n");
nrn++;
}
}
- SETBLACK(0);
- SETBLACK(4);
+ SETBLACK(0)
+ SETBLACK(4)
}
if (line[0] == '-') {
c[0] = '-';
- SETBLUE(0, minor);
+ SETBLUE(0, minor)
}
if (line[0] == '+') {
c[1] = '+';
- SETRED(4, minor);
+ SETRED(4, minor)
}
if (line[1] != '\1') {
line[sl] = nl;
@@ -614,57 +612,57 @@ lwc_diff2html(char *old_fn, char *new_fn
}
} else {
if (line[0] == '-') {
- SETBLACK(0);
+ SETBLACK(0)
fprintf(clmn_fp[0], "\n");
orn++;
}
if (line[0] == '+') {
if (orn > nrn) {
- SETPINK(1, minor);
+ SETPINK(1, minor)
fprintf(clmn_fp[1],
"%i", oln++);
- SETBLACK(1);
+ SETBLACK(1)
fprintf(clmn_fp[1],
"\n");
- SETPINK(2, minor);
+ SETPINK(2, minor)
fprintf(clmn_fp[2],
"!");
- SETBLACK(2);
+ SETBLACK(2)
fprintf(clmn_fp[2],
"\n");
- SETPINK(3, minor);
+ SETPINK(3, minor)
fprintf(clmn_fp[3],
"%i", nln++);
- SETBLACK(3);
+ SETBLACK(3)
fprintf(clmn_fp[3],
"\n");
} else {
- SETBLACK(0);
+ SETBLACK(0)
fprintf(clmn_fp[0],
"\n");
orn++;
- SETBLACK(1);
+ SETBLACK(1)
fprintf(clmn_fp[1],
"\n");
SETRED(2, minor);
fprintf(clmn_fp[2],
"+");
- SETBLACK(2);
+ SETBLACK(2)
fprintf(clmn_fp[2],
"\n");
SETRED(3, minor);
fprintf(clmn_fp[3],
"%i", nln++);
- SETBLACK(3);
+ SETBLACK(3)
fprintf(clmn_fp[3],
"\n");
}
- SETBLACK(4);
+ SETBLACK(4)
fprintf(clmn_fp[4], "\n");
nrn++;
}
if (line[0] == ' ') {
if (!strncmp(c, " ", 2)) {
- SETBLACK(1);
- SETBLACK(2);
- SETBLACK(3);
+ SETBLACK(1)
+ SETBLACK(2)
+ SETBLACK(3)
fprintf(clmn_fp[2],
"\n");
} else {
- SETPINK(1, minor);
- SETPINK(3, minor);
+ SETPINK(1, minor)
+ SETPINK(3, minor)
}
if (!strncmp(c, "-+", 2)) {
- SETPINK(2, minor);
+ SETPINK(2, minor)
fprintf(clmn_fp[2],
"!");
- SETBLACK(2);
+ SETBLACK(2)
fprintf(clmn_fp[2],
"\n");
}
if (!strncmp(c, "- ", 2)) {
@@ -674,20 +672,20 @@ lwc_diff2html(char *old_fn, char *new_fn
fprintf(clmn_fp[2],
"\n");
}
if (!strncmp(c, " +", 2)) {
- SETRED(2, minor);
+ SETRED(2, minor)
fprintf(clmn_fp[2],
"+");
- SETBLACK(2);
+ SETBLACK(2)
fprintf(clmn_fp[2],
"\n");
}
fprintf(clmn_fp[1], "%i",
oln++);
- SETBLACK(1);
+ SETBLACK(1)
fprintf(clmn_fp[1], "\n");
fprintf(clmn_fp[3], "%i",
nln++);
- SETBLACK(3);
+ SETBLACK(3)
fprintf(clmn_fp[3], "\n");
- SETBLACK(0);
+ SETBLACK(0)
fprintf(clmn_fp[0], "\n");
- SETBLACK(4);
+ SETBLACK(4)
fprintf(clmn_fp[4], "\n");
}
snprintf(c, sizeof(c), " ");
@@ -698,16 +696,16 @@ lwc_diff2html(char *old_fn, char *new_fn
}
if (nrn < orn) {
- SETBLACK(3);
- SETBLACK(4);
+ SETBLACK(3)
+ SETBLACK(4)
while (nrn < orn) {
- SETBLUE(1, minor);
+ SETBLUE(1, minor)
fprintf(clmn_fp[1], "%i", oln++);
- SETBLACK(1);
+ SETBLACK(1)
fprintf(clmn_fp[1], "\n");
SETBLUE(2, minor);
fprintf(clmn_fp[2], "-");
- SETBLACK(2);
+ SETBLACK(2)
fprintf(clmn_fp[2], "\n");
fprintf(clmn_fp[3], "\n");
fprintf(clmn_fp[4], "\n");
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list