Page MenuHomeFreeBSD

cdefs: update for C23 and POSIX24
ClosedPublic

Authored by imp on Nov 14 2024, 7:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 1 2025, 5:49 AM
Unknown Object (File)
Feb 25 2025, 12:17 PM
Unknown Object (File)
Feb 22 2025, 2:33 AM
Unknown Object (File)
Jan 31 2025, 4:59 PM
Unknown Object (File)
Dec 27 2024, 7:39 AM
Unknown Object (File)
Dec 27 2024, 4:28 AM
Unknown Object (File)
Dec 27 2024, 4:05 AM
Unknown Object (File)
Dec 26 2024, 1:12 PM

Details

Summary

Sponsored by: Netflix

Diff Detail

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

Event Timeline

imp requested review of this revision.Nov 14 2024, 7:18 PM
imp created this revision.
brooks added inline comments.
share/man/man9/cdefs.9
340

"support" twice is awkward.

363

.St -p1003.1-2024 is available at least in our local implement of mandoc.

410–413

We've also got -isoC-2024

share/man/man9/cdefs.9
410–413

Doh! I tried isoC-2023 and it failed
oh, and 2024 failed too... until I installed a new mandoc.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 15 2024, 2:02 AM
This revision was automatically updated to reflect the committed changes.
gperciva_tarsnap.com added inline comments.
share/man/man9/cdefs.9
388

Sorry for noticing this after it's been committed... but although the standard is C23, the macro is -isoC-2024.

Granted, this won't be the last time somebody does that. One option could be to modify contrib/mandoc/st.c to include:

LINE("-isoC-2011",      "ISO/IEC 9899:2011 (\\(lqISO\\~C11\\(rq)")
+LINE("-isoC-2023",      "ISO/IEC 9899:2024 (\\(lqISO\\~C23\\(rq)")
LINE("-isoC-2024",      "ISO/IEC 9899:2024 (\\(lqISO\\~C23\\(rq)")

The list already includes -isoC and -isoC-90 producing the same text; as do -ansiC and -ansiC-89.

That said, it's probably simpler to change -isoC-2023 to -isoC-2024 in the man page.

share/man/man9/cdefs.9
388

igor warnings might be the only other alternative.

share/man/man9/cdefs.9
388

Checking with mandoc -T lint -W error ... will print an error and exit with non-zero if the file contains .St -isoC-2023.

Other than 3 cases, every non-contrib [*] man page passes -W error with an exit code of 0. Takes 2.5 seconds to check all those 3199 files.

  • I made a haphazard list of "what counts as contrib", erring on the side of excluding directories if I was unsure. For example, I slapped usr.bin/clang/ in the category of "contrib"... although I now see that there's no mandoc-detected errors in those pages, so there was no need to exclude it.