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)
May 9 2024, 10:44 PM
Unknown Object (File)
May 9 2024, 10:44 PM
Unknown Object (File)
May 9 2024, 6:18 PM
Unknown Object (File)
May 9 2024, 2:23 PM
Unknown Object (File)
Apr 14 2024, 5:35 PM
Unknown Object (File)
Apr 8 2024, 10:28 PM
Unknown Object (File)
Mar 18 2024, 4:05 AM
Unknown Object (File)
Mar 18 2024, 4:05 AM
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.