View Issue Details

IDProjectCategoryView StatusLast Update
0024535Open CASCADEOCCT:Application Frameworkpublic2014-05-05 13:39
ReporterabvAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.7.0 
Target Version6.7.1Fixed in Version6.7.1 
Summary0024535: Bad type cast in TDocStd_Document::Update()
DescriptionThis issue is reported by GCC compiler warning on breakage of C pointer aliasing rules, see 0024252:

TDocStd_Document.cxx:227: warning: dereferencing type-punned pointer will break strict-aliasing rules

In this method the address (!) of the input variable aModifContext is casted to pointer to class, then the value of that variable is copied to local variable as if it were that class. This is clearly incorrect.

Note that this method seems to be never called by OCCT (called only by CDM_Document::UpdateFromDocuments() which in turn is not referred from anywhere) and thus probably can be removed.

If it is still needed, then I suppose that the value of argument variable (and not its value) should be casted to pointer of the relevant class (TDocStd_Context).
TagsNo tags attached.
Test case numberNot needed

Relationships

child of 0024252 closedbugmaster GCC warnings on breakage of strict-aliasing rules 

Activities

szy

2014-03-26 16:51

manager   ~0028495

Fixed in branch CR24535.
To be reviewed.

abv

2014-03-26 17:21

manager   ~0028497

No remarks, please test

mkv

2014-03-27 14:34

tester   ~0028511

Dear BugMaster,

Branch CR24535 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: 40dd7c5fae9ea4fc7540296d74bb1b8d46b05206

Number of compiler warnings:

occt component :
Linux: 27 (29 on master)
Windows: 0 (0 on master)

products component :
Linux: 12 (12 on master)
Windows: 2 (2 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 391188912 / 391531872
Total CPU difference: 75461.26999999965 / 51359.449999999655

Testing on Windows:
Total MEMORY difference: 434537344 / 434230736
Total CPU difference: 38522.140625 / 35761.59375

There are no differences in images found by testdiff.

Related Changesets

occt: master 2cb0e213

2014-03-26 12:49:44

szy


Committer: bugmaster Details Diff
0024535: Bad type cast in TDocStd_Document::Update()

Eliminating of GCC compiler warning on breakage of C pointer aliasing rules.
Affected Issues
0024535
mod - src/TDocStd/TDocStd_Document.cxx Diff File

Issue History

Date Modified Username Field Change
2014-01-16 11:36 abv New Issue
2014-01-16 11:36 abv Assigned To => szy
2014-01-16 11:59 abv Relationship added child of 0024252
2014-03-26 16:37 szy Status new => assigned
2014-03-26 16:51 szy Note Added: 0028495
2014-03-26 16:51 szy Assigned To szy => abv
2014-03-26 16:51 szy Status assigned => resolved
2014-03-26 17:21 abv Note Added: 0028497
2014-03-26 17:21 abv Assigned To abv => bugmaster
2014-03-26 17:21 abv Status resolved => reviewed
2014-03-26 17:47 mkv Assigned To bugmaster => mkv
2014-03-27 14:34 mkv Note Added: 0028511
2014-03-27 14:35 mkv Test case number => Not needed
2014-03-27 14:35 mkv Assigned To mkv => bugmaster
2014-03-27 14:35 mkv Status reviewed => tested
2014-03-28 16:38 bugmaster Changeset attached => occt master 2cb0e213
2014-03-28 16:38 bugmaster Status tested => verified
2014-03-28 16:38 bugmaster Resolution open => fixed
2014-05-05 13:33 aiv Status verified => closed
2014-05-05 13:39 aiv Fixed in Version => 6.7.1