View Issue Details

IDProjectCategoryView StatusLast Update
0032916Open CASCADEOCCT:Codingpublic2023-03-19 23:19
ReporterddzamaAssigned Toddzama 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2019 
Product Version7.6.0 
Target Version7.7.0Fixed in Version7.6.3 
Summary0032916: Coding Rules - eliminate MSVS warning C26451 on VS2019/C++20 (Arithmetic overflow: Using operator '+' on a 4 byte value...)
DescriptionMicrosoft Visual Studio Professional 2019
Version 16.11.11
std=c++20

Get rid of `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)`
TagsNo tags attached.
Test case numberNot required

Relationships

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

Activities

git

2022-04-07 14:25

administrator   ~0107686

Branch CR32916 has been created by ddzama.

SHA-1: 505b7fd932f846928585190a3b28fc452fab1d9d


Detailed log of new commits:

Author: Dmitry DZAMA
Date: Thu Mar 31 09:19:35 2022 +0300

    0032916: Coding Rules - eliminate MSVS2019 warning C26451 (Arithmetic overflow: Using operator '+' on a 4 byte value...)
    
    Microsoft Visual Studio Professional 2019
    Version 16.11.11
    std=c++20
    
    Get rid of `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:39

administrator   ~0107701

Branch CR32916 has been updated forcibly by ddzama.

SHA-1: 461f138da1e3de0a7f0c1df83f10d8a9a42538dc

git

2022-04-07 15:10

administrator   ~0107713

Branch CR32916 has been updated forcibly by ddzama.

SHA-1: 8474b1feea93d2a8d9e05b82423ed019232b7b65

kgv

2022-04-08 18:20

developer   ~0107767

Please raise the fix.

smoskvin

2022-04-09 09:50

administrator   ~0107795

Combination -
OCCT branch : IR-2022-04-08
master SHA - 7021de2fe7a69d4c788ccf43b8b096dbcc8597c8
49e51745631c52b6c452c65adae4d6dfa21a1b1e
Products branch : IR-2022-04-08 SHA - e16d959d441765c483049307ba7293173532103a
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: 18452.87000000039 / 18490.94000000032 [-0.21%]
Products
Total CPU difference: 11761.310000000152 / 11719.920000000124 [+0.35%]
Windows-64-VC14:
OCCT
Total CPU difference: 20539.828125 / 20552.71875 [-0.06%]
Products
Total CPU difference: 13248.21875 / 13242.609375 [+0.04%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2023-01-21 21:08

administrator   ~0112950

Branch CR32916 has been deleted by vglukhik.

SHA-1: 8474b1feea93d2a8d9e05b82423ed019232b7b65

Related Changesets

occt: master d31e5dbb

2022-03-31 09:19:35

ddzama


Committer: smoskvin Details Diff
0032916: Coding Rules - eliminate MSVS warning C26451 on VS2019/C++20 (Arithmetic overflow: Using operator '+' on a 4 byte value...)

Microsoft Visual Studio Professional 2019
Version 16.11.11
std=c++20

Get rid of `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
0032916
mod - src/QANCollection/QANCollection_Stl.cxx Diff File

Issue History

Date Modified Username Field Change
2022-04-07 10:23 ddzama New Issue
2022-04-07 10:23 ddzama Assigned To => ddzama
2022-04-07 12:54 kgv Relationship added child of 0032887
2022-04-07 12:55 kgv Product Version 7.7.0 => 7.6.0
2022-04-07 12:55 kgv Summary Coding Rules - eliminate MSVS2019 warning C26451 (Arithmetic overflow: Using operator '+' on a 4 byte value...) => Coding Rules - eliminate MSVS warning C26451 on VS2019/C++20 (Arithmetic overflow: Using operator '+' on a 4 byte value...)
2022-04-07 14:25 git Note Added: 0107686
2022-04-07 14:39 git Note Added: 0107701
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:10 git Note Added: 0107713
2022-04-08 18:20 kgv Assigned To ddzama => bugmaster
2022-04-08 18:20 kgv Status new => resolved
2022-04-08 18:20 kgv Note Added: 0107767
2022-04-08 18:20 kgv Status resolved => reviewed
2022-04-09 09:50 smoskvin Status reviewed => tested
2022-04-09 09:50 smoskvin Note Added: 0107795
2022-04-09 09:53 smoskvin Test case number => Not required
2022-04-10 10:42 smoskvin Changeset attached => occt master d31e5dbb
2022-04-10 10:42 ddzama Assigned To bugmaster => ddzama
2022-04-10 10:42 ddzama Status tested => verified
2022-04-10 10:42 ddzama Resolution open => fixed
2023-01-21 21:08 git Note Added: 0112950
2023-03-19 23:19 vglukhik Status verified => closed
2023-03-19 23:19 vglukhik Fixed in Version => 7.6.3