libconsensus currently can't be used in projects that still use the ANSI C (=ISO C/C89/C90) standard, as the header uses single-line-comments which are only supported since C99:
$ echo '#include "./src/script/bitcoinconsensus.h"\nint main() {}' > consensus_test.c
$ gcc -ansi -c consensus_test.c
In file included from consensus_test.c:1:
./src/script/bitcoinconsensus.h:1:1: error: C++ style comments are not allowed in ISO C90
1 | // Copyright (c) 2009-2010 Satoshi Nakamoto
| ^
./src/script/bitcoinconsensus.h:1:1: note: (this will be reported only once per input file)
In file included from consensus_test.c:1:
./src/script/bitcoinconsensus.h:96:8: warning: extra tokens at end of #endif directive [-Wendif-labels]
96 | #endif // BITCOIN_SCRIPT_BITCOINCONSENSUS_H
| ^
This PR fixed this by changing all single-line comments to /* ... */ comments instead.
I have no knowledge about who current and potential future users of this library are and if this would ever be an issue (apparently it wasn't until now), but it feels to me that the change is trivial enough to be worth it to potentially having to avoid users having to patch the header. As an alternative, we could specify the minimum needed version (i.e. C99) somewhere.