MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0024535Open CASCADE[OCCT] OCCT:Application Frameworkpublic2014-01-16 11:362014-05-05 13:39
Reporterabv 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version[OCCT] 6.7.0 
Target Version[OCCT] 6.7.1Fixed in Version[OCCT] 6.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
Attached Files

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

-  Notes
(0028495)
szy (manager)
2014-03-26 16:51

Fixed in branch CR24535.
To be reviewed.
(0028497)
abv (manager)
2014-03-26 17:21

No remarks, please test
(0028511)
mkv (tester)
2014-03-27 14:34

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
Timestamp: 2014-03-26 12:49:44
Author: 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.
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


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker