[cfe-dev] __has_feature(fuzzer)

Jon Roelofs via cfe-dev cfe-dev at lists.llvm.org
Wed Mar 25 09:07:10 PDT 2020


I noticed there were several __has_feature tests for the rest of the
sanitizers, but none for the fuzzer. Is that an intentional omission, or
would it be a useful addition? If the latter, I'd be happy to upstream this
WIP patch to add it [1].

I'm imagining it would be very useful in order to simplify build systems,
among other things:

#if __has_feature(fuzzer)
int LLVMFuzzerTestOneInput(const uint8_t *D, size_t S) {/*...*/}
#else
int main() { fprintf(stderr, "error: not built with fuzzer support\n");
return -1; }
#endif

Jon

1: https://gist.github.com/jroelofs/588c49d2d3c8510abaa9a1e29a1aaba4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200325/7979e1ab/attachment-0001.html>


More information about the cfe-dev mailing list