Archived issue #0024095

Eliminate compiler warning C4512 in MSVC++ with warning level 4

Open CASCADEOCCT:Codingclosed10 public notes

Search issues

Description

When compiling OCCT 6.6.0 with warning level set to 4, MSVC 2008 compiler produces many warnings c4512: assignment operator couldn't be generated.

Public activity

10 archived notes

Participants are labeled by their role within this record.

01Commenter 1
Dear abv,
Please, review the changes made by the branch CR24095.
02Commenter 2
Reviewed... though it would be nice to have all the dummy copy constructors and assignment operators private (this is not the case now for some structs) and accompanied by appropriate comment (protection against compiler warning).
03Commenter 3
Dear omy,
could you please rebase this fix to current master.
04Commenter 4
Dear mkv,
the branch has been rebased.
Please, test.
05Commenter 5
Dear Commenter 1,

Branch CR24095 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]

Number of compiler warnings:
http://jenkins-test-02.nnov.opencascade.com:8080/user/mnt/my-views/view/Warnings/
occt component :
Linux: 954 (947 on master)
Windows: 883 (891 on master)

products component :
Linux: 188 (188 on master)
Windows: 287 (287 on master)

Regressions:
No regressions

Improvements:
No improvements

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 363994252 / 363673640
Total CPU difference: 62219.93000000034 / 43423.94000000051

Testing on Windows:
Total MEMORY difference: 425760848 / 424306804
Total CPU difference: 39447.109375 / 54556.21875

There are not differences in images found by testdiff.
06Commenter 6
One of new warnings is:

../../../../inc/LDOM_MemManager.hxx: In member function ‘LDOM_MemManager::HashTable& LDOM_MemManager::HashTable::operator=(const LDOM_MemManager::HashTable&)’:
../../../../inc/LDOM_MemManager.hxx:112: warning: no return statement in function returning non-void

Empty assignment operators should have return type void
07Commenter 7
Dear Commenter 1,
see following new warning compilation on Linux:

-------
http://jenkins-test-02.nnov.opencascade.com:8080/user/mnt/my-views/view/CR24095/job/mnt-CR24095-master_build_occt_linux/1/warnings14Result/package.-671474530/
IntImpParGen_Intersector.gxx:47

NCollection_IndexedDataMap.hxx:228
dereferencing type-punned pointer will break strict-aliasing rulesIn file included from ../../../../inc/BOPCol_MapOfInteger.hxx:33

NCollection_Map.hxx:179
dereferencing type-punned pointer will break strict-aliasing rulesIn file included from ../../../../inc/BOPCol_MapOfInteger.hxx:33

SelectMgr_CompareResults.hxx:37
no return statement in function returning non-void

VrmlData_InBuffer.hxx:41
no return statement in function returning non-void

VrmlData_ShapeConvert.hxx:115
no return statement in function returning non-void

-------
http://jenkins-test-02.nnov.opencascade.com:8080/user/mnt/my-views/view/CR24095/job/mnt-CR24095-master_build_occt_linux/1/warnings14Result/package.103948317/
Extrema_GenExtPS.cxx:79
no return statement in function returning non-void

-------
http://jenkins-test-02.nnov.opencascade.com:8080/user/mnt/my-views/view/CR24095/job/mnt-CR24095-master_build_occt_linux/1/warnings14Result/package.-827086367/
LDOM_CharReference.cxx:43
no return statement in function returning non-void
08Commenter 8
Dear abv,
I've made necessary corrections.
Please, review.
09Commenter 9
No remarks, please test
10Commenter 10
Dear Commenter 1,

Branch CR24095 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]

Number of compiler warnings:

occt component :
Linux: 947 (947 on master)
Windows: 883 (891 on master)

products component :
Linux: 188 (188 on master)
Windows: 287 (287 on master)

Regressions:
No regressions

Improvements:
No improvements

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 363962632 / 363651324
Total CPU difference: 43495.390000000654 / 43422.890000000516

Testing on Windows:
Total MEMORY difference: 424135848 / 424101868
Total CPU difference: 41627.421875 / 53402.609375

There are not differences in images found by testdiff.

Related records