Module Name:    src
Committed By:   rillig
Date:           Tue Aug 25 17:37:09 UTC 2020

Modified Files:
        src/usr.bin/make: buf.h make_malloc.h metachar.h strlist.c

Log Message:
make(1): allow make to be compiled in C90 mode

Since the inline functions are the only C99 feature used by now, setting
USER_CFLAGS='-std=c90 -ansi -Dinline=' is enough for compiling make with
a C90 compiler.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/make/buf.h
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/make_malloc.h
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/metachar.h
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/strlist.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/buf.h
diff -u src/usr.bin/make/buf.h:1.25 src/usr.bin/make/buf.h:1.26
--- src/usr.bin/make/buf.h:1.25	Thu Aug 13 04:25:09 2020
+++ src/usr.bin/make/buf.h	Tue Aug 25 17:37:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.h,v 1.25 2020/08/13 04:25:09 rillig Exp $	*/
+/*	$NetBSD: buf.h,v 1.26 2020/08/25 17:37:09 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -96,7 +96,7 @@ typedef struct Buffer {
 void Buf_Expand_1(Buffer *);
 
 /* Buf_AddByte adds a single byte to a buffer. */
-static inline void
+static inline void MAKE_ATTR_UNUSED
 Buf_AddByte(Buffer *bp, char byte)
 {
     size_t count = ++bp->count;
@@ -108,7 +108,7 @@ Buf_AddByte(Buffer *bp, char byte)
     ptr[0] = 0;
 }
 
-static inline size_t
+static inline size_t MAKE_ATTR_UNUSED
 Buf_Size(const Buffer *bp)
 {
     return bp->count;

Index: src/usr.bin/make/make_malloc.h
diff -u src/usr.bin/make/make_malloc.h:1.7 src/usr.bin/make/make_malloc.h:1.8
--- src/usr.bin/make/make_malloc.h:1.7	Thu Aug 20 06:35:14 2020
+++ src/usr.bin/make/make_malloc.h	Tue Aug 25 17:37:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make_malloc.h,v 1.7 2020/08/20 06:35:14 rillig Exp $	*/
+/*	$NetBSD: make_malloc.h,v 1.8 2020/08/25 17:37:09 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@ char *bmake_strldup(const char *, size_t
  *
  * The case of a NULL pointer happens especially often after Var_Value,
  * since only environment variables need to be freed, but not others. */
-static inline void
+static inline void MAKE_ATTR_UNUSED
 bmake_free(void *p)
 {
     if (p != NULL)

Index: src/usr.bin/make/metachar.h
diff -u src/usr.bin/make/metachar.h:1.6 src/usr.bin/make/metachar.h:1.7
--- src/usr.bin/make/metachar.h:1.6	Sun Aug 23 17:04:21 2020
+++ src/usr.bin/make/metachar.h	Tue Aug 25 17:37:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: metachar.h,v 1.6 2020/08/23 17:04:21 rillig Exp $	*/
+/*	$NetBSD: metachar.h,v 1.7 2020/08/25 17:37:09 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -31,13 +31,13 @@
 #ifndef MAKE_METACHAR_H
 #define MAKE_METACHAR_H
 
-#include <ctype.h>
+#include "make.h"
 
 extern unsigned char _metachar[];
 
 #define ismeta(c)	_metachar[(c) & 0x7f]
 
-static inline int
+static inline int MAKE_ATTR_UNUSED
 needshell(const char *cmd, int white)
 {
 	while (!ismeta(*cmd) && *cmd != ':' && *cmd != '=') {

Index: src/usr.bin/make/strlist.c
diff -u src/usr.bin/make/strlist.c:1.5 src/usr.bin/make/strlist.c:1.6
--- src/usr.bin/make/strlist.c:1.5	Sun Aug  9 19:51:02 2020
+++ src/usr.bin/make/strlist.c	Tue Aug 25 17:37:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: strlist.c,v 1.5 2020/08/09 19:51:02 rillig Exp $	*/
+/*	$NetBSD: strlist.c,v 1.6 2020/08/25 17:37:09 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2008 - 2009 The NetBSD Foundation, Inc.
@@ -33,18 +33,16 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: strlist.c,v 1.5 2020/08/09 19:51:02 rillig Exp $";
+static char rcsid[] = "$NetBSD: strlist.c,v 1.6 2020/08/25 17:37:09 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: strlist.c,v 1.5 2020/08/09 19:51:02 rillig Exp $");
+__RCSID("$NetBSD: strlist.c,v 1.6 2020/08/25 17:37:09 rillig Exp $");
 #endif /* not lint */
 #endif
 
-#include <stddef.h>
-#include <stdlib.h>
+#include "make.h"
 #include "strlist.h"
-#include "make_malloc.h"
 
 void
 strlist_init(strlist_t *sl)

Reply via email to