Page MenuHomeFreeBSD

config: make changes to allow some parts to build as C++
ClosedPublic

Authored by kevans on Jan 30 2023, 3:54 PM.
Tags
None
Referenced Files
F102651296: D38274.diff
Fri, Nov 15, 8:51 AM
Unknown Object (File)
Sep 27 2024, 2:23 AM
Unknown Object (File)
Sep 24 2024, 1:01 PM
Unknown Object (File)
Sep 24 2024, 1:01 PM
Unknown Object (File)
Sep 24 2024, 1:00 PM
Unknown Object (File)
Sep 24 2024, 12:50 PM
Unknown Object (File)
Sep 20 2024, 8:58 AM
Unknown Object (File)
Sep 18 2024, 1:29 PM
Subscribers

Details

Summary

Highlights:

  • Avoid keywords (this, not) as variable names
  • Move yyparse into config.h with other declarations
  • All declarations in config.h are assumed guilty until proven innocent
  • Some const-correctness
  • Casting malloc/calloc returns

Note that we're not building any C++ here yet, this will be introduced
in other commits to replace some of the lib dependencies.

Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.

Diff Detail

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

Event Timeline

kevans created this revision.

This looks good and is quite mechanical.
My only question is implicit reliance on sys/cdefs.h being included... but that's going to give a compile error if that becomes not the case in the future.

usr.sbin/config/config.h
45

Do we know for sure sys/cdefs.h has been included?

usr.sbin/config/main.c
701

It's unfortunate we have to do this :(

This revision is now accepted and ready to land.Jan 30 2023, 4:41 PM
usr.sbin/config/config.h
45

We do in the sense that sys/types.h unconditionally includes it, but I' can go ahead and make it explicit