MantisBT - Open CASCADE
View Issue Details
0024534Open CASCADE[OCCT] OCCT:Visualizationpublic2014-01-16 11:222014-11-11 12:51
abv 
abv 
normalminor 
closedfixed 
LinuxDebian 4.064 bit
[OCCT] 6.7.0 
[OCCT] 6.8.0[OCCT] 6.8.0 
Not needed
0024534: Improve design of Image_PixMap class
This issue is highlighed by GCC compiler warning on breakage of C strict aliasing rules in type conversion, see 0024252:

Image_PixMap.hxx:247: warning: dereferencing type-punned pointer will break strict-aliasing rules

The actual problem seems to be poor design of Image_PixMap class: it has a field of the type Image_PixMapData<Standard_Byte> but provides a means to address it as if it had different type (via its methods EditData(), ReadData(), Value()). This is obviously incorrect.

One possibility to fix it could be providing method to convert between Image_PixMapData<> classes with different template argument, and make correct instance when needed (possibly creating several instances sharing the same buffer).
No tags attached.
related to 0024406closed apn Visualization - crash on re-usage of the same primitive array 
related to 0024405closed apn TKernel - add aligned allocator class NCollection_AlignedAllocator 
child of 0024252closed bugmaster GCC warnings on breakage of strict-aliasing rules 
Issue History
2014-01-16 11:22abvNew Issue
2014-01-16 11:22abvAssigned To => san
2014-01-16 11:25abvRelationship addedchild of 0024252
2014-01-16 11:36abvProduct Version => 6.7.0
2014-01-16 11:36abvTarget Version => 6.7.1
2014-02-05 12:45sanAssigned Tosan => kgv
2014-02-05 12:45sanStatusnew => assigned
2014-03-29 18:52kgvRelationship addedrelated to 0024406
2014-03-29 18:53kgvRelationship addedrelated to 0024405
2014-04-03 12:27kgvNote Added: 0028650
2014-04-03 12:27kgvAssigned Tokgv => san
2014-04-03 12:27kgvStatusassigned => resolved
2014-04-03 12:27kgvSummaryPoor design of Image_PixMap class => Improve design of Image_PixMap class
2014-04-04 09:21sanNote Added: 0028670
2014-04-04 09:21sanAssigned Tosan => bugmaster
2014-04-04 09:21sanStatusresolved => reviewed
2014-04-04 09:22sanNote Edited: 0028670bug_revision_view_page.php?bugnote_id=28670#r7142
2014-04-04 16:26abvTarget Version6.7.1 => 6.8.0
2014-04-04 17:55mkvAssigned Tobugmaster => apn
2014-04-08 15:46apnNote Added: 0028743
2014-04-08 15:48apnTest case number => Not needed
2014-04-08 15:48apnAssigned Toapn => bugmaster
2014-04-08 15:48apnStatusreviewed => tested
2014-04-11 14:43abvChangeset attached => occt master ca0c0b11
2014-04-11 14:43abvAssigned Tobugmaster => abv
2014-04-11 14:43abvStatustested => verified
2014-04-11 14:43abvResolutionopen => fixed
2014-11-11 12:47aivFixed in Version => 6.8.0
2014-11-11 12:51aivStatusverified => closed

Notes
(0028650)
kgv   
2014-04-03 12:27   
Patch for OCCT and Products is ready for review in branch CR24534_1 (based on CR24405).
(0028670)
san   
2014-04-04 09:21   
(edited on: 2014-04-04 09:22)
Branch CR24534_1 reviewed in occt and occt-products without remarks, ready for testing.

(0028743)
apn   
2014-04-08 15:46   
Dear BugMaster,

OCCT and Products branch CR24534_1 was compiled on Linux and Windows platforms and tested.
SHA-1: b97dd89f9e256987a5de3175b7aa04cda087ed16

Number of compiler warnings:

occt component :
Linux: 24 (27 on master) - 3 warnings in inc/Image_PixMap.hxx were removed
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: 395027512 / 350990000
Total CPU difference: 58587.06999999985 / 50414.12000000013

Testing on Windows:
Total MEMORY difference: 437939848 / 380569632
Total CPU difference: 35148.125 / 36389.671875

There are no differences in images found by testdiff.