make(1): fix position of MAKE_ATTR_UNUSED in inline functions

The attribute needs to be before the return type, otherwise GCC 5
complains that Hash_GetValue is defined but not used, when compiling
with USER_CPPFLAGS=-Dinline=.  The other functions don't get any
warnings.  It's probably because Hash_GetValue is the only inline
function that returns a pointer.
This commit is contained in:
rillig 2020-09-13 15:27:25 +00:00
parent 6de75a95f8
commit de337db564
5 changed files with 12 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: buf.h,v 1.28 2020/09/01 17:38:26 rillig Exp $ */
/* $NetBSD: buf.h,v 1.29 2020/09/13 15:27:25 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@ -94,7 +94,7 @@ typedef struct Buffer {
void Buf_Expand_1(Buffer *);
/* Buf_AddByte adds a single byte to a buffer. */
static inline void MAKE_ATTR_UNUSED
static inline MAKE_ATTR_UNUSED void
Buf_AddByte(Buffer *bp, char byte)
{
size_t count = ++bp->count;
@ -106,7 +106,7 @@ Buf_AddByte(Buffer *bp, char byte)
ptr[0] = 0;
}
static inline size_t MAKE_ATTR_UNUSED
static inline MAKE_ATTR_UNUSED size_t
Buf_Size(const Buffer *bp)
{
return bp->count;

View File

@ -1,4 +1,4 @@
/* $NetBSD: hash.h,v 1.22 2020/09/05 13:55:08 rillig Exp $ */
/* $NetBSD: hash.h,v 1.23 2020/09/13 15:27:25 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@ -106,13 +106,13 @@ typedef struct Hash_Search {
Hash_Entry *entry; /* Next entry to check in current bucket. */
} Hash_Search;
static inline void * MAKE_ATTR_UNUSED
static inline MAKE_ATTR_UNUSED void *
Hash_GetValue(Hash_Entry *h)
{
return h->value;
}
static inline void MAKE_ATTR_UNUSED
static inline MAKE_ATTR_UNUSED void
Hash_SetValue(Hash_Entry *h, void *datum)
{
h->value = datum;

View File

@ -1,4 +1,4 @@
/* $NetBSD: make_malloc.h,v 1.10 2020/08/29 16:47:45 rillig Exp $ */
/* $NetBSD: make_malloc.h,v 1.11 2020/09/13 15:27:25 rillig Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@ -46,7 +46,7 @@ char *bmake_strsedup(const char *, const char *);
*
* 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 MAKE_ATTR_UNUSED
static inline MAKE_ATTR_UNUSED void
bmake_free(void *p)
{
if (p != NULL)

View File

@ -1,4 +1,4 @@
/* $NetBSD: metachar.h,v 1.8 2020/09/11 17:32:36 rillig Exp $ */
/* $NetBSD: metachar.h,v 1.9 2020/09/13 15:27:25 rillig Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@ extern unsigned char _metachar[];
#define ismeta(c) _metachar[(c) & 0x7f]
static inline int MAKE_ATTR_UNUSED
static inline MAKE_ATTR_UNUSED int
needshell(const char *cmd, int white)
{
while (!ismeta(*cmd) && *cmd != ':' && *cmd != '=') {

View File

@ -1,4 +1,4 @@
/* $NetBSD: nonints.h,v 1.117 2020/09/13 13:50:27 rillig Exp $ */
/* $NetBSD: nonints.h,v 1.118 2020/09/13 15:27:25 rillig Exp $ */
/*-
* Copyright (c) 1988, 1989, 1990, 1993
@ -138,7 +138,7 @@ typedef struct {
} Words;
Words Str_Words(const char *, Boolean);
static inline void MAKE_ATTR_UNUSED
static inline MAKE_ATTR_UNUSED void
Words_Free(Words w) {
free(w.words);
free(w.freeIt);