crunchgen: quiet -Wmissing-prototypes
ClosedPublic

Authored by rlibby on Aug 23 2017, 7:54 AM.

Details

Test Plan
buildworld; installworld
/rescue/rescue (usage)
/rescue/rescue foo (usage)
/rescue/rescue ls

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rlibby created this revision.Aug 23 2017, 7:54 AM
emaste accepted this revision.Aug 26 2017, 3:04 PM
This revision is now accepted and ready to land.Aug 26 2017, 3:04 PM
rlibby added inline comments.Aug 26 2017, 11:21 PM
usr.sbin/crunch/crunchgen/crunchgen.c
1108 ↗(On Diff #32333)

Whoops, that extra "\n" led to the following makefile template, from strings $(which crunchgen):

%s_stub.c:
        echo "extern int main(int argc, char **argv, char **envp);
int _crunched_%s_stub(int argc, char **argv, char **envp){return main(argc,argv,envp);}" >%s_stub.c
%s.lo: %s_stub.o $(%s_OBJPATHS)

I didn't notice earlier, apparently the build is using the installed crunchgen (rather than the one being built)?

New version replaces the line feed with a space and gives this from
strings /usr/obj/usr/src/freebsd/usr.sbin/crunch/crunchgen/crunchgen:

%s_stub.c:
        echo "extern int main(int argc, char **argv, char **envp); int _crunched_%s_stub(int argc, char **argv, char **envp){return main(argc,argv,envp);}" >%s_stub.c
%s.lo: %s_stub.o $(%s_OBJPATHS)
rlibby updated this revision to Diff 32419.Aug 26 2017, 11:24 PM

Keep generated stub on one line.

This revision now requires review to proceed.Aug 26 2017, 11:24 PM
This revision was automatically updated to reflect the committed changes.