Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

build: fix warning in Clang 10#24664

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
opencv-pushbot merged 1 commit intoopencv:4.xfromtomoaki0705:warning_fix_clang
Dec 8, 2023

Conversation

@tomoaki0705
Copy link
Contributor

I had a chance to build OpenCV with clang 10.
I found 5 lines of warnings and I think it's worth to prevent it.

/opencv/3rdparty/carotene/src/div.cpp:160:19: warning: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Wi[0/1875]int-float-conversion]         (scale * std::numeric_limits<T>::max()) <  1.0f &&                ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~/opencv/3rdparty/carotene/src/div.cpp:453:5: note: in instantiation of function template specialization 'carotene_o4t::(anonymous namespace)::div<int>' requested here    div<s32>(size, src0Base, src0Stride, src1Base, src1Stride, dstBase, dstStride, scale, cpolicy);    ^/opencv/3rdparty/carotene/src/div.cpp:161:19: warning: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Wimplicit-int-float-conversion]         (scale * std::numeric_limits<T>::max()) > -1.0f))                ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~2 warnings generated.
/opencv/3rdparty/openjpeg/openjp2/j2k.c:7799:29: warning: implicit conversion from 'int' to 'float' changes value from 2147483647 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 2147483647 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.
/opencv/3rdparty/openexr/IlmImf/ImfConvert.cpp:110:31: warning: implicit conversion from 'unsigned int' to 'float' changes value from 4294967295 to 4294967296 [-Wimplicit-int-float-conversion]    if (isInfinity (f) || f > UINT_MAX)                            ~ ^~~~~~~~/usr/lib/llvm-10/lib/clang/10.0.0/include/limits.h:56:37: note: expanded from macro 'UINT_MAX'#define UINT_MAX  (__INT_MAX__  *2U +1U)                   ~~~~~~~~~~~~~~~~~^~~1 warning generated.

Pull Request Readiness Checklist

See details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

Copy link
Contributor

@asmorkalovasmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍

@opencv-pushbotopencv-pushbot merged commit681ee0e intoopencv:4.xDec 8, 2023
@tomoaki0705tomoaki0705 deleted the warning_fix_clang branchDecember 8, 2023 11:59
@asmorkalovasmorkalov mentioned this pull requestJan 19, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@asmorkalovasmorkalovasmorkalov approved these changes

@opencv-alalekopencv-alalekopencv-alalek approved these changes

@mshabuninmshabuninAwaiting requested review from mshabunin

Assignees

@asmorkalovasmorkalov

Projects

None yet

Milestone

4.9.0

Development

Successfully merging this pull request may close these issues.

4 participants

@tomoaki0705@asmorkalov@opencv-alalek@opencv-pushbot

[8]ページ先頭

©2009-2025 Movatter.jp