__has_feature(fuzzer)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

__has_feature(fuzzer)

Fangrui Song via cfe-dev
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


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev