Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jan 2024 06:15:38 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 259e6fefc0ad - main - test-includes: Add -ansi to the compile line to catch problems
Message-ID:  <202401010615.4016Fcba036393@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=259e6fefc0adc5f253920922653e868ab2cbe373

commit 259e6fefc0adc5f253920922653e868ab2cbe373
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-01-01 06:12:54 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-01-01 06:14:08 +0000

    test-includes: Add -ansi to the compile line to catch problems
    
    We support C89 files, but compile everything in the tree with C99 or
    newer. By compiling these -ansi, that will force C89 which doesn't
    understand inline. All our header files must use __inline instead of
    inline when they define inline functions.
    
    Sponsored by:           Netflix
    Reviewed by:            emaste
    Differential Revision:  https://reviews.freebsd.org/D43235
---
 tools/build/test-includes/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/build/test-includes/Makefile b/tools/build/test-includes/Makefile
index 174c4341331c..2c25e0fb32ce 100644
--- a/tools/build/test-includes/Makefile
+++ b/tools/build/test-includes/Makefile
@@ -22,6 +22,10 @@ NO_PIC=	yes
 # Some files have to be clean for extra defines too...
 CFLAGS.event.c=	-D_WANT_KEVENT32 -D_WANT_FREEBSD11_KEVENT
 
+# We currently support C89 and newer compilers. Catch the odd little fussy
+# details like __inline that the header files must follow to support C89.
+CFLAGS+=-ansi
+
 .include "badfiles.inc"
 
 .for h c in ${HDRS:@x@$x ${x:S,/,_,g:R}.c@}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202401010615.4016Fcba036393>