Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make make(1): allow make to be compiled in C90 mode
details: https://anonhg.NetBSD.org/src/rev/8eaf939355dd
branches: trunk
changeset: 943073:8eaf939355dd
user: rillig <rillig%NetBSD.org@localhost>
date: Tue Aug 25 17:37:09 2020 +0000
description:
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.
diffstat:
usr.bin/make/buf.h | 6 +++---
usr.bin/make/make_malloc.h | 4 ++--
usr.bin/make/metachar.h | 6 +++---
usr.bin/make/strlist.c | 10 ++++------
4 files changed, 12 insertions(+), 14 deletions(-)
diffs (101 lines):
diff -r 1123873ec14b -r 8eaf939355dd usr.bin/make/buf.h
--- a/usr.bin/make/buf.h Tue Aug 25 16:50:02 2020 +0000
+++ b/usr.bin/make/buf.h Tue Aug 25 17:37:09 2020 +0000
@@ -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 @@
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 @@
ptr[0] = 0;
}
-static inline size_t
+static inline size_t MAKE_ATTR_UNUSED
Buf_Size(const Buffer *bp)
{
return bp->count;
diff -r 1123873ec14b -r 8eaf939355dd usr.bin/make/make_malloc.h
--- a/usr.bin/make/make_malloc.h Tue Aug 25 16:50:02 2020 +0000
+++ b/usr.bin/make/make_malloc.h Tue Aug 25 17:37:09 2020 +0000
@@ -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 @@
*
* 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)
diff -r 1123873ec14b -r 8eaf939355dd usr.bin/make/metachar.h
--- a/usr.bin/make/metachar.h Tue Aug 25 16:50:02 2020 +0000
+++ b/usr.bin/make/metachar.h Tue Aug 25 17:37:09 2020 +0000
@@ -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 != '=') {
diff -r 1123873ec14b -r 8eaf939355dd usr.bin/make/strlist.c
--- a/usr.bin/make/strlist.c Tue Aug 25 16:50:02 2020 +0000
+++ b/usr.bin/make/strlist.c Tue Aug 25 17:37:09 2020 +0000
@@ -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)
Home |
Main Index |
Thread Index |
Old Index