Skip to content

Comments

cgo: silence false-positive clang warning#55

Closed
JackMordaunt wants to merge 3 commits intochai2010:masterfrom
JackMordaunt:master
Closed

cgo: silence false-positive clang warning#55
JackMordaunt wants to merge 3 commits intochai2010:masterfrom
JackMordaunt:master

Conversation

@JackMordaunt
Copy link

Every build with Clang spits out this annoying warning message:

# github.com/chai2010/webp
In file included from z_libwebp_src_enc_picture_csp_enc.c:9: ../../../../go/pkg/mod/github.com/chai2010/webp@v1.1.1/internal/libwebp-1.0.2/src/enc/picture_csp_enc.c:1002:40: warning: result of '2 ^ ALPHA_OFFSET' is 1; did you mean '1 << ALPHA_OFFSET' (8)? [-Wxor-used-as-pow]

This commits silences that warning by supplying the requisite CFLAG.

Signed-off-by: Jack Mordaunt jackmordaunt.dev@gmail.com

Every build with Clang spits out this annoying warning message:

\# github.com/chai2010/webp
In file included from z_libwebp_src_enc_picture_csp_enc.c:9:
../../../../go/pkg/mod/github.com/chai2010/webp@v1.1.1/internal/libwebp-1.0.2/src/enc/picture_csp_enc.c:1002:40: warning: result of '2 ^ ALPHA_OFFSET' is 1; did you mean '1 << ALPHA_OFFSET' (8)? [-Wxor-used-as-pow]

This commits silences that warning by supplying the requisite CFLAG.

Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
@lloyd
Copy link

lloyd commented Jan 26, 2023

👍

love it!

This makes it very hard to consume if a different decoder is desired.

Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
@cinemast
Copy link

@chai2010 any chance we can get at least the commit to silence the warning merged and released?

@JackMordaunt
Copy link
Author

@cinemast don't hold your breath. You can find an alternative at https://git.sr.ht/~jackmordaunt/go-libwebp

@jphastings
Copy link

jphastings commented Dec 9, 2024

I just tested #73 locally and it also removes the warning (it bumps to v1.4.0 of libwebp).

Drop the following in your go.mod file and run go mod tidy to get it working:

replace github.com/chai2010/webp => github.com/chirino/webp v0.0.0-20240906184250-8b3bed1ecc92

(you can use github.com/chirino/webp webp-1.4.0 instead of the specific version, but I've only verified the hash above is good)

chai2010 added a commit that referenced this pull request Apr 6, 2025
@jphastings
Copy link

As you’ve merged #73 @chai2010 (thank you!) this PR is no longer relevant 😊

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

Successfully merging this pull request may close these issues.

4 participants