Skip to content
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

unnecessary compilation noise #270

Open
fabiangreffrath opened this issue Jul 23, 2024 · 2 comments
Open

unnecessary compilation noise #270

fabiangreffrath opened this issue Jul 23, 2024 · 2 comments

Comments

@fabiangreffrath
Copy link

Hi there,

could we please get rid of this message - or at least only show it if not explicitly built with miniz as the zlib API provider?

Thanks!

#pragma message ("inflateValidate() not available, SPNG_CTX_IGNORE_ADLER32 will be ignored")

@randy408
Copy link
Owner

AFAIK it shows up not just with miniz but also for very old and insecure zlib versions, I wouldn't call that unnecessary.

It has to be a compile-time message, the function that takes SPNG_CTX_IGNORE_ADLER32 does not return an error code, it is the only way to know that feature will not work. Making it a build system message wouldn't really work either because compiling the library without the included build files is explicitly supported.

@fabiangreffrath
Copy link
Author

AFAIK it shows up not just with miniz but also for very old and insecure zlib versions, I wouldn't call that unnecessary.

I see. My point is that if I explicitly build with -DSPNG_USE_MINIZ then I'm already aware of the fact that I'm building with a reduced/minimal zlib API implementation and I don't need to be remembered every time I rebuild my project.

My idea is something like this:

--- a/spng/spng.c
+++ b/spng/spng.c
@@ -1208,7 +1208,7 @@ static int spng__inflate_init(spng_ctx *ctx, int window_bits)
 
     if(inflateValidate(&ctx->zstream, validate)) return SPNG_EZLIB_INIT;
 
-#else /* This requires zlib >= 1.2.11 */
+#else if !defined(SPNG_USE_MINIZ) /* This requires zlib >= 1.2.11 */
     #pragma message ("inflateValidate() not available, SPNG_CTX_IGNORE_ADLER32 will be ignored")
 #endif
 

But, of course, it's your choice in the end. I could understand if you just said "no" and close this issue. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants