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
Unknown Object (File)
Sat, Oct 25, 11:11 PM
Unknown Object (File)
Mon, Oct 20, 12:05 AM
Unknown Object (File)
Fri, Oct 17, 8:02 AM
Unknown Object (File)
Thu, Oct 16, 12:46 PM
Unknown Object (File)
Thu, Oct 16, 12:46 PM
Unknown Object (File)
Thu, Oct 16, 12:46 PM
Unknown Object (File)
Thu, Oct 16, 1:04 AM
Unknown Object (File)
Sep 7 2025, 6:22 PM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 33447

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
91
usr.sbin/crunch/crunchgen/crunchgen.c
938
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.