chiark / gitweb /
regress: Allow harness code to wrap main if it wants to
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 19 Nov 2016 18:24:48 +0000 (18:24 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 11 Jun 2020 15:13:02 +0000 (16:13 +0100)
commite3ae2174187923d1ad43227458ef9bdaaa1f878e
treeb4ba648af0b2ce401d7305083e6b9ae38991e83e
parent0236fa7eeb392bb9ca8a89bd45ad508e3e0ac942
regress: Allow harness code to wrap main if it wants to

The fuzzer is going to want to wrap main().  This is a bit awkward
because everyone defines it their own way (in ways which are obviously
equivalent but which trigger compiler warnings).  Our warnings mean we
have to make sure the comiler sees a declaration.

Luckily the only occurence of main() anywhere in one of the client
programs is (necessarily) the definition of main, which is always
defined to return int.  So we can arrange the expansion to produce
both declaration and definition of Hmain.

Then in hnonfuzz.c we need to declare Hmain.  (Which we can't declare
in the global header file.)  We hope that type errors in main are
unlikely.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
regress/hnonfuzz.c
regress/hredirect.h.m4