Page MenuHomeFreeBSD

crunchgen(8): fix crunched application build with WARNS=6
ClosedPublic

Authored by kevans on Sep 8 2020, 8:20 PM.
Tags
None
Referenced Files
F132391904: D26363.id.diff
Thu, Oct 16, 12:46 PM
F132391898: D26363.id76893.diff
Thu, Oct 16, 12:46 PM
F132391895: D26363.id76783.diff
Thu, Oct 16, 12:46 PM
Unknown Object (File)
Thu, Oct 16, 1:04 AM
Unknown Object (File)
Sep 7 2025, 6:22 PM
Unknown Object (File)
Aug 22 2025, 8:23 PM
Unknown Object (File)
Jul 20 2025, 1:29 PM
Unknown Object (File)
Jul 17 2025, 4:16 AM
Subscribers

Details

Summary

This was revealed by the rescue build with a patch I'm working on to default WARNS=6 everywhere. The main issues were:

  • Missing prototype for _crunched_${ident}_stub in the *_stub.c generated bits
  • Missing prototype for crunched_main
  • Incomplete prototype for _crunched_${ident}_stub in the generated parts of crunched_main
  • Literal strings in the stub table must drop const qualifier, unless we const'ify name
  • f field in struct stub didn't have a proper prototype

Most of these issues are minor formalities and easily addressed.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kevans requested review of this revision.Sep 8 2020, 8:20 PM

LGTM. I probably wouldn't bother with the typedef and just add the parameters but don't mind either way.

usr.sbin/crunch/crunchgen/crunched_main.c
83 ↗(On Diff #76783)
91 ↗(On Diff #76783)
usr.sbin/crunch/crunchgen/crunchgen.c
938 ↗(On Diff #76783)
This revision is now accepted and ready to land.Sep 9 2020, 8:16 AM

LGTM. I probably wouldn't bother with the typedef and just add the parameters but don't mind either way.

I don't feel too strongly about the typedef, personally- I added it when I had this grand delusion of a header that I could eventually move it to so both crunched_main and the stub objects have a consistent idea of the signature. I realized that would be both silly and annoying, but kept the typedef to prove to myself consistency between the crunched_main signature and the entry point callbacks.