New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify and document C and C++ standard support #1293
Comments
As for Since we don't have any issue with this "incompatibility", it seems okay for our users. |
Since many of them can be compiled with
I personally think we can ignore C17 at all. Because we don't (and won't) use deprecated feature.
Actually, we already have C23 notation (
It's great to have them on CI environment. We'll need to make compilers × C++ versions support matrix though.
I think they don't need it. Because they have |
We seem to have a quite complex system of C and C++ standards we support, and this system has no documentation. Please help me understand the situation and correct me if I'm wrong anywhere.
C standards
It seems like the core lz4 library and CLI (everything under
lib/
andprograms/
) is targeting C90 when compiling a release build. No//
-style comments, declarations only at the top of blocks, etc. But the support seems incomplete. For example, the only reasonmake c_standards_c90
succeeds is because it compiles with-Wno-long-long -Wno-variadic-macros
. Why are these incompatibilities allowed, but others aren't? When compiling withLX4_DEBUG
defined, there are even more incompatibilities (%z
specifier inprintf()
, for example).The
contrib/
directory seems to have no restrictions; any language, any standard.examples/Makefile
forces GNU99 (CFLAGS += -std=gnu99
) butexamples/
compiles perfectly fine as C99 and later standards.The
ossfuzz/
,examples/
, andtests/
directories seem to target C99 (they certainly don't compile as C90), and yet in those directories there is code that looks like:Should this be removed?
make c_standards_c17
test. Is that because C17 is too similar to C11 to be worth the trouble?make c_standards_c23
test. Is that because C23 is not supported well enough yet?C++ standards
make ctocpptest
, which ensureslz4/
andtests/
can compile as C++ (no standard specified).make cxx17build
, which ensureslz4/
,tests/
, andprograms/
can compile specifically as C++17. Should it be added to CI? Should there be correspondingcxx11build
,cxx20build
, and so on?examples/Makefile
enables the-Wc++-compat
flag, which isn't used anywhere else. Should it be added to the rest of the project, or at leastlib/
,tests/
, andprograms/
?The text was updated successfully, but these errors were encountered: