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)
Thu, May 9, 6:52 PM
Unknown Object (File)
Mar 22 2024, 8:57 PM
Unknown Object (File)
Mar 9 2024, 6:25 AM
Unknown Object (File)
Jan 9 2024, 3:58 AM
Unknown Object (File)
Jan 4 2024, 2:59 PM
Unknown Object (File)
Jan 4 2024, 2:34 PM
Unknown Object (File)
Dec 20 2023, 3:39 AM
Unknown Object (File)
Jul 4 2023, 7:18 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.