Page MenuHomeFreeBSD

test-includes: Add -ansi to the compile line to catch problems
ClosedPublic

Authored by imp on Dec 29 2023, 9:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 16, 9:15 PM
Unknown Object (File)
Tue, Apr 8, 4:52 PM
Unknown Object (File)
Mar 2 2025, 4:29 AM
Unknown Object (File)
Feb 11 2025, 1:11 PM
Unknown Object (File)
Feb 11 2025, 12:50 PM
Unknown Object (File)
Feb 11 2025, 12:30 PM
Unknown Object (File)
Feb 11 2025, 7:05 AM
Unknown Object (File)
Feb 10 2025, 5:19 PM
Subscribers
None

Details

Summary

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

Test Plan

Open Question: Does this suffice, or do we need to do all supported C standard variations?
Not an open question: K&R: that's a hard no today.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Dec 29 2023, 9:30 PM
imp created this revision.
imp added reviewers: dim, emaste, jrtc27.

I'm happy with this if it passes. One small comment on a comment though.

tools/build/test-includes/Makefile
25

is "niggles" likely to be widely understood?

This revision is now accepted and ready to land.Dec 29 2023, 9:36 PM

Does this suffice, or do we need to do all supported C standard variations?

Comprehensive testing would be nice, but checking for the specific cases we've encountered is probably sufficient.

reword comment to use more main-stream language.

This revision now requires review to proceed.Dec 29 2023, 10:56 PM
imp marked an inline comment as done.Dec 29 2023, 10:58 PM
imp added inline comments.
tools/build/test-includes/Makefile
25

Well... maybe... but I reworded it to be less obscure.... but fussy details might be a better match, since niggles connotes annoying things more so than fussy details.

This revision was not accepted when it landed; it landed in state Needs Review.Jan 1 2024, 6:16 AM
This revision was automatically updated to reflect the committed changes.
imp marked an inline comment as done.