Open yurivict opened 2 years ago
This is probably why gcc is needed according to the README.md: It uses nested functions in the tests, which are a gcc extension. Clang can do something similar using blocks, but libcsptr just uses a gcc-only nested function
Hah, I wasn't expecting anyone to be porting libcsptr to FreeBSD :) The tests do need fixing so they don't use nested functions on clang. I guess either use regular static functions that write global state or fix lambda() so that it uses blocks on clang, since the tests require a C compiler with GNU extensions.
I have added some changes here to make the tests pass with clang. As I am not really familiar with CMake, I am not sure about that part.
In total, it were quite a bit more changes than I had hoped, but it passes the tests now:
https://github.com/hcmh/libcsptr/tree/clang
I can make a pull-request with those changes if you like
Rev. ac73451 clang-13 FreeBSD 13.1