From 6bf2b616ac320f4915394e83d59bcf7553b3d14f Mon Sep 17 00:00:00 2001 From: Hartmut Brandt Date: Thu, 12 May 2005 15:41:02 +0000 Subject: [PATCH] Use a variable initialized to a string instead of the string directly to get rid of a const warning. Submitted by: Max Okumoto (7.244) --- usr.bin/make/Makefile | 2 +- usr.bin/make/cond.c | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/usr.bin/make/Makefile b/usr.bin/make/Makefile index 40903eb34b02..bbb03de3c994 100644 --- a/usr.bin/make/Makefile +++ b/usr.bin/make/Makefile @@ -8,7 +8,7 @@ SRCS= arch.c buf.c cond.c dir.c for.c hash.c hash_tables.c job.c \ lst.c main.c make.c parse.c str.c suff.c targ.c util.c var.c NO_WERROR= -WARNS?= 3 +WARNS?= 4 NO_SHARED?= YES CFLAGS+=-DMAKE_VERSION=\"5200408120\" diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c index 81065231d13e..a9209b10ca89 100644 --- a/usr.bin/make/cond.c +++ b/usr.bin/make/cond.c @@ -476,11 +476,12 @@ CondToken(Boolean doEval) t = EndOfFile; break; case '$': { - char *lhs; - char *rhs; - const char *op; - size_t varSpecLen = 0; - Boolean doFree; + char *lhs; + const char *op; + char *rhs; + char zero[] = "0"; + size_t varSpecLen = 0; + Boolean doFree; /* * Parse the variable spec and skip over it, saving its @@ -557,7 +558,7 @@ CondToken(Boolean doEval) default: op = "!="; - rhs = "0"; + rhs = zero; break; } if (*rhs == '"') {