CSAL icon indicating copy to clipboard operation
CSAL copied to clipboard

Fix compilation issue when BAREMETAL flag is set

Open davkap15 opened this issue 2 years ago • 1 comments

When compiling for BAREMETAL functions the functions under define is in use also (it's in use not only for DEBUG as stated in the comment)

davkap15 avatar Nov 16 '22 21:11 davkap15

I can't reproduce a bug here. There were a couple other issues with BAREMETAL, which I've now fixed. In particular BAREMETAL no longer tries to build the demo tools.

These functions are only used in asserts internally in cs_topology.c. They are not exported as part of the library API. If you build CSAL with DEBUG=1 they will be compiled. If you build with DEBUG=0, the makefile will set NDEBUG=1 which should define assert() as ((void)0) or similar. I wonder if your compiler evaluates the argument to assert() even in a non-debug build. Or are you using a different makefile, which ends up with neither DEBUG nor NDEBUG set?

Do you mean that you would find it useful if they were exported? We could consider that but the header would need changing as well.

algrant-arm avatar Nov 21 '22 21:11 algrant-arm