Repository navigation
Fix missing <cstdlib> include with libc++ 23 - #150
Conversation
Could you let me know what the compile error output is and on which compiler?
The C++ headers are no more correct than the C headers, and they have a higher compile time cost. I would prefer to remain with the C headers. |
It's Clang 23.1.0. This is the output when compiling from the main branch:
When compiling C++ the C++ specification technically does not guarantee that the C headers exist. It's a technicality and realistically not something to worry about, however it is technically not standard code. Also, yes they might incur a slightly higher cost, but they all quickly boil down to this (this is from #if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
# include <__cxx03/cassert>
#else
# include <__config>
// <assert.h> is not provided by libc++
# if __has_include(<assert.h>)
# include <assert.h>
# ifdef _LIBCPP_ASSERT_H
# error "If libc++ starts defining <assert.h>, the __has_include check should move to libc++'s <assert.h>"
# endif
# endif
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)And in the example of |
Thanks, that's helpful.
I am not a big fan of what most C++ people call good practice, and enkiTS is partially a reaction to that. Adding extra cruft over long established functions to add them to a namespace does not seem to be a real advantage in practical terms.
Yes please. Many thanks for the PR and speedy responses. |
d07adab to
1c703cb
Compare
|
Merged, many thanks. |
adds the
<cstdlib>include required formalloc,free, andposix_memalign.also fixed two other includes to use the correct C++ headers instead of the C headers