View Issue Details

IDProjectCategoryView StatusLast Update
0032903Open CASCADEOCCT:Codingpublic2023-03-19 19:04
ReporterddzamaAssigned Toddzama 
PrioritynormalSeverityintegration request 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2019 
Product Version7.6.0 
Target Version7.7.0Fixed in Version7.6.3 
Summary0032903: Coding Rules - eliminate MSVC warning C26451 on VS2019/C++20
DescriptionWhen C++20 enables, warning messages occures:
Put explicit type casting to avoid: Warning C26451 Arithmetic overflow: Using operator '-' on a 4 byte value and then casting the result to a 8 byte value.
Cast the value to the wider type before calling operator '-' to avoid overflow (io.2).
Steps To ReproduceNot required
TagsNo tags attached.
Test case numberN/A

Relationships

child of 0032887 assignedddzama Coding - Problem of compilation on VS2019/C++20 

Activities

git

2022-04-05 09:39

administrator   ~0107619

Branch CR0032903 has been created by ddzama.

SHA-1: db4bf50c9fd2d73cf9d89685cbfcbaec118bc3fc


Detailed log of new commits:

Author: Dmitry DZAMA
Date: Tue Mar 29 16:32:46 2022 +0300

    0032903: Get rid of warning message C26451 on VS 2019/C++20
    
    Put explicit type casting to avoid:
    When C++20 enables, warning messages occures:
    Put explicit type casting to avoid:
    Warning C26451 Arithmetic overflow: Using operator '-' on a 4 byte
    value and then casting the result to a 8 byte value.
    Cast the value to the wider type before calling operator '-' to avoid overflow (io.2).

git

2022-04-05 09:42

administrator   ~0107620

Branch CR0032903 has been deleted by ddzama.

SHA-1: db4bf50c9fd2d73cf9d89685cbfcbaec118bc3fc

git

2022-04-05 09:43

administrator   ~0107621

Branch CR32903 has been created by ddzama.

SHA-1: db4bf50c9fd2d73cf9d89685cbfcbaec118bc3fc


Detailed log of new commits:

Author: Dmitry DZAMA
Date: Tue Mar 29 16:32:46 2022 +0300

    0032903: Get rid of warning message C26451 on VS 2019/C++20
    
    Put explicit type casting to avoid:
    When C++20 enables, warning messages occures:
    Put explicit type casting to avoid:
    Warning C26451 Arithmetic overflow: Using operator '-' on a 4 byte
    value and then casting the result to a 8 byte value.
    Cast the value to the wider type before calling operator '-' to avoid overflow (io.2).

git

2022-04-07 14:36

administrator   ~0107693

Branch CR32903 has been updated forcibly by ddzama.

SHA-1: f06188416ab7d294d00378fa5332f5eefe38cdef

git

2022-04-07 15:22

administrator   ~0107720

Branch CR32903 has been updated forcibly by ddzama.

SHA-1: 70e8f0105c987aa496d50871078c8d5edeeaa2e7

kgv

2022-04-08 14:54

developer   ~0107759

@ddzama,

there should be no "merge" commits in the patch,

ddzama

2022-04-08 15:09

developer   ~0107761

Jenkins testing:

http://jenkins-test-occt.nnov.opencascade.com/view/CR32887-master-ddzama/view/TESTING/

kgv

2022-04-08 18:09

developer   ~0107763

+      const double aDelta_x = (double)(aDelta.x());
+      const double aDelta_y = (double)(aDelta.y());

Graphic3d_Vec2d aDeltaF (aDelta);

+      if ( std::fabs(aDelta_x) + std::fabs(aDelta_y) > aPanTol )

Abs()

In addition, patch has to be rebased onto current IR / updated next week as IR includes modification in the same place.

git

2022-04-20 13:35

administrator   ~0108046

Branch CR32903 has been updated forcibly by ddzama.

SHA-1: 4baa1b64fceb743bb03d6245019852268dcf4fad

git

2022-04-25 17:46

administrator   ~0108168

Branch CR32903 has been updated forcibly by ddzama.

SHA-1: d2c44be0f44c7006caa0d96498d6d7a27ca7717f

git

2022-04-26 21:27

administrator   ~0108198

Branch CR32903_1 has been created by kgv.

SHA-1: 7da34757e1ef91e6ae5a801ac377655868555d72


Detailed log of new commits:

Author: Dmitry DZAMA
Date: Tue Mar 29 16:32:46 2022 +0300

    0032903: Coding Rules - eliminate MSVC warning C26451 on VS2019/C++20
    
    Put explicit type casting to avoid:
    Warning C26451 Arithmetic overflow: Using operator '-' on a 4 byte
    value and then casting the result to a 8 byte value.
    Cast the value to the wider type before calling operator '-' to avoid overflow (io.2).

kgv

2022-04-26 21:28

developer   ~0108199

Please raise the patch
- OCCT: branch CR32903_1.

smoskvin

2022-05-01 13:28

administrator   ~0108268

Combination -
OCCT branch : IR-2022-04-29
master SHA - e976df232941aae838b8c3dcf4b9f79f79bea705
49e51745631c52b6c452c65adae4d6dfa21a1b1e
Products branch : IR-2022-04-29 SHA - d8a13f7f0c119514dcb0285266e54f3994f65e57
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 18668.100000000675 / 18636.43000000061 [+0.17%]
Products
Total CPU difference: 11742.710000000114 / 11717.180000000135 [+0.22%]
Windows-64-VC14:
OCCT
Total CPU difference: 20733.796875 / 20693.28125 [+0.20%]
Products
Total CPU difference: 13272.875 / 13248.015625 [+0.19%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2022-05-01 15:14

administrator   ~0108272

Branch CR32903 has been deleted by mnt.

SHA-1: d2c44be0f44c7006caa0d96498d6d7a27ca7717f

git

2022-05-01 15:14

administrator   ~0108273

Branch CR32903_1 has been deleted by mnt.

SHA-1: 7da34757e1ef91e6ae5a801ac377655868555d72

Related Changesets

occt: master 4e1b5fcb

2022-03-29 16:32:46

ddzama


Committer: smoskvin Details Diff
0032903: Coding Rules - eliminate MSVC warning C26451 on VS2019/C++20

Put explicit type casting to avoid:
Warning C26451 Arithmetic overflow: Using operator '-' on a 4 byte
value and then casting the result to a 8 byte value.
Cast the value to the wider type before calling operator '-' to avoid overflow (io.2).
Affected Issues
0032903
mod - src/AIS/AIS_ViewController.cxx Diff File
mod - src/Graphic3d/Graphic3d_ArrayOfPrimitives.hxx Diff File
mod - src/Message/Message_ProgressScope.hxx Diff File
mod - src/Standard/Standard_Real.hxx Diff File

Issue History

Date Modified Username Field Change
2022-04-04 16:57 ddzama New Issue
2022-04-04 16:57 ddzama Assigned To => kgv
2022-04-04 16:58 ddzama Relationship added child of 0032887
2022-04-05 09:39 git Note Added: 0107619
2022-04-05 09:42 git Note Added: 0107620
2022-04-05 09:43 git Note Added: 0107621
2022-04-05 10:03 ddzama Relationship added parent of 0032906
2022-04-05 10:05 ddzama Relationship deleted child of 0032887
2022-04-05 10:05 ddzama Relationship deleted parent of 0032906
2022-04-05 10:05 ddzama Relationship added child of 0032906
2022-04-07 12:32 kgv Relationship added child of 0032887
2022-04-07 12:32 kgv Product Version 7.7.0 => 7.6.0
2022-04-07 12:32 kgv Summary Get rid of warning message C26451 on VS 2019/C++20 => Coding Rules - eliminate MSVC warning C26451 on VS 2019/C++20
2022-04-07 12:33 kgv Relationship deleted child of 0032906
2022-04-07 12:34 kgv Summary Coding Rules - eliminate MSVC warning C26451 on VS 2019/C++20 => Coding Rules - eliminate MSVC warning C26451 on VS2019/C++20
2022-04-07 14:36 git Note Added: 0107693
2022-04-07 14:52 ddzama Relationship deleted child of 0032887
2022-04-07 14:53 ddzama Relationship added child of 0032887
2022-04-07 15:22 git Note Added: 0107720
2022-04-08 14:54 kgv Note Added: 0107759
2022-04-08 14:54 kgv File Added: image.png
2022-04-08 15:09 ddzama Note Added: 0107761
2022-04-08 15:09 kgv File Deleted: image.png
2022-04-08 18:09 kgv Note Added: 0107763
2022-04-08 18:09 kgv Assigned To kgv => ddzama
2022-04-08 18:09 kgv Status new => assigned
2022-04-20 13:35 git Note Added: 0108046
2022-04-25 17:46 git Note Added: 0108168
2022-04-26 11:20 ddzama Assigned To ddzama => kgv
2022-04-26 11:20 ddzama Status assigned => resolved
2022-04-26 11:20 ddzama Steps to Reproduce Updated
2022-04-26 21:27 git Note Added: 0108198
2022-04-26 21:28 kgv Assigned To kgv => bugmaster
2022-04-26 21:28 kgv Status resolved => reviewed
2022-04-26 21:28 kgv Test case number => N/A
2022-04-26 21:28 kgv Note Added: 0108199
2022-05-01 13:28 smoskvin Status reviewed => tested
2022-05-01 13:28 smoskvin Note Added: 0108268
2022-05-01 14:32 smoskvin Changeset attached => occt master 4e1b5fcb
2022-05-01 14:32 ddzama Assigned To bugmaster => ddzama
2022-05-01 14:32 ddzama Status tested => verified
2022-05-01 14:32 ddzama Resolution open => fixed
2022-05-01 15:14 git Note Added: 0108272
2022-05-01 15:14 git Note Added: 0108273
2023-03-19 19:04 vglukhik Status verified => closed
2023-03-19 19:04 vglukhik Fixed in Version => 7.6.3