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

suppress warning during build using clang #1494

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

tomoaki0705
Copy link
Contributor

I had a chance to build OpenCV with clang 10 and realized some warnings happening.
I created PR in OpenCV and now I'm porting to upstream.

/opencv/3rdparty/openjpeg/openjp2/j2k.c:7799:29: warning: implicit conversion from 'int' to 'float' changes value from 21
47483647 to 2147483648 [-Wimplicit-int-float-conversion]
            if (temp_size > INT_MAX) {
                          ~ ^~~~~~~
/usr/lib/llvm-10/lib/clang/10.0.0/include/limits.h:46:19: note: expanded from macro 'INT_MAX'
#define INT_MAX   __INT_MAX__
                  ^~~~~~~~~~~
<built-in>:37:21: note: expanded from here
#define __INT_MAX__ 2147483647
                    ^~~~~~~~~~
1 warning generated.
/opencv/3rdparty/openjpeg/openjp2/tcd.c:2265:35: warning: implicit conversion from 'int' to 'float' changes value from 21
47483647 to 2147483648 [-Wimplicit-int-float-conversion]
                    if (l_value > INT_MAX) {
                                ~ ^~~~~~~
/usr/lib/llvm-10/lib/clang/10.0.0/include/limits.h:46:19: note: expanded from macro 'INT_MAX'
#define INT_MAX   __INT_MAX__
                  ^~~~~~~~~~~
<built-in>:37:21: note: expanded from here
#define __INT_MAX__ 2147483647
                    ^~~~~~~~~~
1 warning generated.

It's just a warning of corner case, but I think it's worth preventing it.

@rouault
Copy link
Collaborator

rouault commented Dec 8, 2023

thanks

@rouault rouault merged commit 65282a0 into uclouvain:master Dec 8, 2023
1 check failed
@tomoaki0705 tomoaki0705 deleted the suppress_warning_clang branch December 8, 2023 15:49
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.

2 participants