From c5d4b7b2f260c85ba48db4e844c4a2e4e3004238 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Tue, 7 Sep 2021 01:02:25 -0400 Subject: [PATCH] Clean up more Windows warnings. * src/config.h.W32.template: Re-enable warnings that we don't violate. Add a new disabled warning: 4130 (logical operation on address of string constant). * src/w32/compat/posixfcn.c: Make makeint.h the first included header. * src/w32/subproc/sub_proc.c: Ditto. It includes config.h already. --- src/config.h.W32.template | 7 +++---- src/w32/compat/posixfcn.c | 3 ++- src/w32/subproc/sub_proc.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/config.h.W32.template b/src/config.h.W32.template index 347f4201..f847be87 100644 --- a/src/config.h.W32.template +++ b/src/config.h.W32.template @@ -19,12 +19,11 @@ this program. If not, see . */ Maybe after the code cleanup for ISO C we can remove some/all of these. */ #if _MSC_VER > 1000 # pragma warning(disable:4100) /* unreferenced formal parameter */ -# pragma warning(disable:4102) /* unreferenced label */ -# pragma warning(disable:4127) /* conditional expression is constant */ +# pragma warning(disable:4130) /* logical operation on address of string constant */ # pragma warning(disable:4131) /* uses old-style declarator */ # pragma warning(disable:4702) /* unreachable code */ -# define _CRT_SECURE_NO_WARNINGS /* function or variable may be unsafe */ -# define _CRT_NONSTDC_NO_WARNINGS /* functions w/o a leading underscore */ +# define _CRT_SECURE_NO_WARNINGS 1 /* function or variable may be unsafe */ +# define _CRT_NONSTDC_NO_WARNINGS 1 /* functions w/o a leading underscore */ #endif /* Define to 1 if the 'closedir' function returns void instead of 'int'. */ diff --git a/src/w32/compat/posixfcn.c b/src/w32/compat/posixfcn.c index 00d87e00..0bd1be00 100644 --- a/src/w32/compat/posixfcn.c +++ b/src/w32/compat/posixfcn.c @@ -15,6 +15,8 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "makeint.h" + #include #include #include @@ -23,7 +25,6 @@ this program. If not, see . */ #include "dlfcn.h" -#include "makeint.h" #include "job.h" #ifndef NO_OUTPUT_SYNC diff --git a/src/w32/subproc/sub_proc.c b/src/w32/subproc/sub_proc.c index c0c4f44d..b8984be8 100644 --- a/src/w32/subproc/sub_proc.c +++ b/src/w32/subproc/sub_proc.c @@ -14,8 +14,9 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "makeint.h" + #include -#include #include #include #include /* for _get_osfhandle */ @@ -29,7 +30,6 @@ this program. If not, see . */ #include #include -#include "makeint.h" #include "filedef.h" #include "variable.h" #include "sub_proc.h"