From 7aeb91f4d5bbdab0a353cfce09be487fa5c14d42 Mon Sep 17 00:00:00 2001 From: rillig Date: Sat, 29 Aug 2020 07:52:55 +0000 Subject: make(1): allow for strict type checking for Boolean Having Boolean aliased to int creates ambiguities since int is widely used. Allow to occasionally compile make with -DUSE_DOUBLE_BOOLEAN to check that the type definitions still agree. --- usr.bin/make/parse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'usr.bin/make/parse.c') diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index c61e19765c0..8db626917c9 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.268 2020/08/28 04:48:57 rillig Exp $ */ +/* $NetBSD: parse.c,v 1.269 2020/08/29 07:52:55 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.268 2020/08/28 04:48:57 rillig Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.269 2020/08/29 07:52:55 rillig Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.268 2020/08/28 04:48:57 rillig Exp $"); +__RCSID("$NetBSD: parse.c,v 1.269 2020/08/29 07:52:55 rillig Exp $"); #endif #endif /* not lint */ #endif @@ -2541,7 +2541,7 @@ IsInclude(const char *line, Boolean sysv) static const size_t inclen = sizeof(inc) - 1; /* 'd' is not valid for sysv */ - int o = strchr(&("ds-"[sysv]), *line) != NULL; + int o = strchr(sysv ? "s-" : "ds-", *line) != NULL; if (strncmp(line + o, inc, inclen) != 0) return FALSE; -- cgit