View Issue Details

IDProjectCategoryView StatusLast Update
0026783Open CASCADEOCCT:Codingpublic2016-04-20 15:51
Reporterkgv Assigned Toabv  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformLinuxOSDebian 6.0 
Product Version6.9.1 
Target Version7.0.0Fixed in Version7.0.0 
Summary0026783: Coding rules - eliminate GCC warning -Wunused-but-set-parameter
Descriptiongcc 4.9.2 generates the following warnings with -Wextra option which should be fixed:
/occt/src/TopOpeBRep/TopOpeBRep_vprdeg.cxx|970|warning: parameter ‘hasOOEi’ set but not used [-Wunused-but-set-parameter]|
/occt/src/TestTopOpeDraw/TestTopOpeDraw_Displayer.hxx|54|warning: parameter ‘Tol’ set but not used [-Wunused-but-set-parameter]|
/occt/src/TestTopOpeDraw/TestTopOpeDraw_Displayer.hxx|58|warning: parameter ‘Par’ set but not used [-Wunused-but-set-parameter]|

Steps To ReproduceN/A
TagsNo tags attached.
Test case numberNot needed

Relationships

related to 0026854 closedabv Open CASCADE Use -Wextra with GCC 

Activities

git

2015-10-27 10:44

administrator   ~0047464

Branch CR26783 has been created by rkv.

SHA-1: 0ed1895ae904c2bcb622f336faa53bc3a212cd43


Detailed log of new commits:

Author: rkv
Date: Tue Oct 27 10:44:12 2015 +0300

    26783: Coding rules - eliminate GCC warning -Wunused-but-set-parameter
    Pass parameters by reference to be able to change/return their values.

git

2015-10-27 11:02

administrator   ~0047465

Branch CR26783 has been updated forcibly by kgv.

SHA-1: fe6501fca6e6598857873fda4d289d593bd71fe4

kgv

2015-10-27 11:03

developer   ~0047466

Please test the patch.

mkv

2015-10-28 15:19

tester   ~0047538

Dear BugMaster,
Branch CR26783 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: fe6501fca6e6598857873fda4d289d593bd71fe4

Number of compiler warnings:

occt component :
Linux: 1 (1 on master)
Windows: 0 (0 on master)

products component :
Linux: 39 (39 on master)
Windows: 0 (0 on master)

Regressions/Differences/Improvements:
http://occt-tests/CR26783-master-occt-64/Debian70-64/bugs/fclasses/bug23237.html
http://occt-tests/CR26783-master-occt-64/Windows-64-VC10/bugs/fclasses/bug23237.html
bugs fclasses bug23237: FAILED

Testing cases:
Not needed

Testing on Linux:
occt component :
Total MEMORY difference: 92604178 / 92333587 [+0.29%]
Total CPU difference: 19741.309999999703 / 19729.38999999969 [+0.06%]
products component :
Total MEMORY difference: 26215978 / 26272952 [-0.22%]
Total CPU difference: 7541.049999999976 / 7371.560000000013 [+2.30%]

Testing on Windows:
occt component :
Total MEMORY difference: 58410402 / 58044644 [+0.63%]
Total CPU difference: 18440.176205498705 / 18131.590627399022 [+1.70%]
products component :
Total MEMORY difference: 17260148 / 17167510 [+0.54%]
Total CPU difference: 5674.005971599975 / 5658.655473199974 [+0.27%]

There are no differences in images found by testdiff.

mkv

2015-10-28 15:20

tester   ~0047539

Dear rkv,
Branch CR26783 has been rejected due to:
- regressions/differences/improvements

git

2015-10-29 10:41

administrator   ~0047574

Branch CR26783 has been updated by rkv.

SHA-1: 44545c167f9a80a7f8e79d727239b3b2f5be8a08


Detailed log of new commits:

Author: rkv
Date: Thu Oct 29 10:41:22 2015 +0300

    Merge branch 'CR26783' of git.dev.opencascade.org:occt into CR26783

Author: rkv
Date: Thu Oct 29 10:40:38 2015 +0300

    0026783: Coding rules - eliminate GCC warning -Wunused-but-set-parameter
    Unreachable code is commented.

Author: rkv
Date: Tue Oct 27 10:44:12 2015 +0300

    26783: Coding rules - eliminate GCC warning -Wunused-but-set-parameter
    Pass parameters by reference to be able to change/return their values.

git

2015-10-29 10:48

administrator   ~0047578

Branch CR26783 has been deleted by rkv.

SHA-1: 44545c167f9a80a7f8e79d727239b3b2f5be8a08

git

2015-10-29 10:55

administrator   ~0047580

Branch CR26783 has been created by rkv.

SHA-1: 735a48f2d8e8d7dd1425c9b60a74638d641e713a


Detailed log of new commits:

Author: rkv
Date: Thu Oct 29 10:52:52 2015 +0300

    0026783: Coding rules - eliminate GCC warning -Wunused-but-set-parameter
    Parameters are turned to prarmeters by reference. Unreachable code is commented.

kgv

2015-11-05 12:19

developer   ~0047803

Dear Mikhail,

-    if (hasOOEi) {
-      Handle(TopOpeBRepDS_Interference) EVI1i = ::MakeEPVInterference(T1ondg,iOOEi,PVIndex,par1ondg,
-                                         TopOpeBRepDS_VERTEX,TopOpeBRepDS_EDGE,isvertex1);
-      myHDS->StoreInterference(EVI1i,dgEd);
-    }
+    //if (hasOOEi) {
+    //  Handle(TopOpeBRepDS_Interference) EVI1i = ::MakeEPVInterference(T1ondg,iOOEi,PVIndex,par1ondg,
+                               //        TopOpeBRepDS_VERTEX,TopOpeBRepDS_EDGE,isvertex1);
+    //  myHDS->StoreInterference(EVI1i,dgEd);
+    //}

could you please confirm or reject removing these code paths?

msv

2015-11-05 16:00

developer   ~0047832

I agree with these changes. This code is a part of old Booleans, we should not spend much time to make it better, so just elimination of warning is enough.

kgv

2015-11-05 16:02

developer   ~0047833

OK, then commented code should be removed within the patch.

git

2015-11-05 16:09

administrator   ~0047835

Branch CR26783_1 has been created by kgv.

SHA-1: 7a86234b173a5ba5171a5797b037fb8dd05047b5


Detailed log of new commits:

Author: rkv
Date: Thu Nov 5 16:07:37 2015 +0300

    0026783: Coding rules - eliminate GCC warning -Wunused-but-set-parameter
    
    TestTopOpeDraw_Displayer::GetTol(), GetPar() - pass assigned parameters by reference.
    TopOpeBRep_FacesFiller::ProcessVPondgE() - remove unreachable code.

kgv

2015-11-05 16:09

developer   ~0047836

Please test updated patch in branch CR26783_1.

msv

2015-11-05 16:10

developer   ~0047837

I would not remove the old code, because in such way we make distortion in the initial idea of the code. All this code should be removed, and it will be removed some time. I don't see any sense of removing the commented out code. May be it is better to insert there an explanation of making it commented.

kgv

2015-11-05 16:15

developer   ~0047838

> May be it is better to insert there an explanation of making it commented.
this is explained by commit description and kept for history within git.
So usually there no need to keep bloated code in file itself.

git

2015-11-05 16:39

administrator   ~0047843

Branch CR26783 has been updated forcibly by mkv.

SHA-1: c62ba57e8a4fc6dabb435062cae67a1b2030a5ac

kgv

2015-11-05 19:27

developer   ~0047848

> Branch CR26783 has been updated forcibly by mkv.
what for this branch has been rebased?

abv

2015-11-08 19:15

manager   ~0047922

I agree with Mikhail: it is better to keep inactive code commented, as it will make it easier to see how offending variable (hasOOEi) was intended to be used, while looking at the code (without digging in Git history). Alternatively, we shall remove hasOOEi completely, also from FUN_putInterfonDegenEd(), but we seem to have no real interest in tracing all this now...

On the other side, I find it reasonable to remove ~650 commented lines of code at the beginning of that file -- this code seems to contain alternative implementation of the same stuff, never used.

git

2015-11-08 19:16

administrator   ~0047923

Branch CR26783_2 has been created by abv.

SHA-1: 7375a13a8033d0129f30b24c73351103940e9cc5


Detailed log of new commits:

Author: rkv
Date: Thu Nov 5 16:07:37 2015 +0300

    0026783: Coding rules - eliminate GCC warning -Wunused-but-set-parameter
    
    TestTopOpeDraw_Displayer::GetTol(), GetPar() - pass assigned parameters by reference.
    TopOpeBRep_vprdeg.cxx, TopOpeBRep_FacesFiller::ProcessVPondgE() - remove commented code, comment inactive code.

mkv

2015-11-09 14:35

tester   ~0047952

Dear BugMaster,
Branch CR26783_2 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms on Release mode.
SHA-1: 7375a13a8033d0129f30b24c73351103940e9cc5

There are following compilation errors:

Linux:
http://jenkins-test-01.nnov.opencascade.com:8080/view/CR26783-2-master/job/CR26783-2-master_build_occt_linux/1/parsed_console/
../../../../src/RWStepDimTol/RWStepDimTol_RWNonUniformZoneDefinition.cxx:21:45: fatal error: StepRepr_HArray1OfShapeAspect.hxx: No such file or directory

Windows:
http://jenkins-test-01.nnov.opencascade.com:8080/view/CR26783-2-master/job/CR26783-2-master_build_occt_windows_64/1/parsed_console/
         d:\builds\vc10\CR26783-2-master-occt-64\inc\StepDimTol_ToleranceZoneDefinition.hxx(24): fatal error C1083: Cannot open include file: 'StepRepr_HArray1OfShapeAspect.hxx': No such file or directory
         d:\builds\vc10\CR26783-2-master-occt-64\inc\StepDimTol_ToleranceZoneDefinition.hxx(24): fatal error C1083: Cannot open include file: 'StepRepr_HArray1OfShapeAspect.hxx': No such file or directory
         d:\builds\vc10\CR26783-2-master-occt-64\inc\StepDimTol_ToleranceZoneDefinition.hxx(24): fatal error C1083: Cannot open include file: 'StepRepr_HArray1OfShapeAspect.hxx': No such file or directory
         d:\builds\vc10\CR26783-2-master-occt-64\inc\StepDimTol_ToleranceZoneDefinition.hxx(24): fatal error C1083: Cannot open include file: 'StepRepr_HArray1OfShapeAspect.hxx': No such file or directory
         ..\..\..\src\RWStepDimTol\RWStepDimTol_RWNonUniformZoneDefinition.cxx(21): fatal error C1083: Cannot open include file: 'StepRepr_HArray1OfShapeAspect.hxx': No such file or directory
         ..\..\..\src\RWStepDimTol\RWStepDimTol_RWProjectedZoneDefinition.cxx(22): fatal error C1083: Cannot open include file: 'StepRepr_HArray1OfShapeAspect.hxx': No such file or directory
         ..\..\..\src\RWStepDimTol\RWStepDimTol_RWRunoutZoneDefinition.cxx(21): fatal error C1083: Cannot open include file: 'StepRepr_HArray1OfShapeAspect.hxx': No such file or directory
         ..\..\..\src\RWStepDimTol\RWStepDimTol_RWToleranceZoneDefinition.cxx(21): fatal error C1083: Cannot open include file: 'StepRepr_HArray1OfShapeAspect.hxx': No such file or directory

abv

2015-11-09 15:59

manager   ~0047957

The problem was due to lost hxx files in StepRepr/FILES in fix for 0026850 on which branch CR26783 is based; now corrected

git

2016-04-17 14:23

administrator   ~0053151

Branch CR26783 has been deleted by kgv.

SHA-1: c62ba57e8a4fc6dabb435062cae67a1b2030a5ac

git

2016-04-17 14:23

administrator   ~0053152

Branch CR26783_1 has been deleted by kgv.

SHA-1: 7a86234b173a5ba5171a5797b037fb8dd05047b5

git

2016-04-17 14:23

administrator   ~0053153

Branch CR26783_2 has been deleted by kgv.

SHA-1: 7375a13a8033d0129f30b24c73351103940e9cc5

Related Changesets

occt: master 3d18f1e0

2015-11-05 13:07:37

abv


Committer: abv Details Diff
0026783: Coding rules - eliminate GCC warning -Wunused-but-set-parameter

TestTopOpeDraw_Displayer::GetTol(), GetPar() - pass assigned parameters by reference.
TopOpeBRep_vprdeg.cxx, TopOpeBRep_FacesFiller::ProcessVPondgE() - remove commented code, comment inactive code.
Affected Issues
0026783
mod - src/TestTopOpeDraw/TestTopOpeDraw_Displayer.hxx Diff File
mod - src/TopOpeBRep/TopOpeBRep_vprdeg.cxx Diff File

Issue History

Date Modified Username Field Change
2015-10-16 10:49 kgv New Issue
2015-10-16 10:49 kgv Assigned To => kgv
2015-10-16 10:49 kgv Assigned To kgv => rkv
2015-10-16 10:49 kgv Status new => assigned
2015-10-27 10:44 git Note Added: 0047464
2015-10-27 10:44 rkv Assigned To rkv => kgv
2015-10-27 10:44 rkv Status assigned => resolved
2015-10-27 11:02 git Note Added: 0047465
2015-10-27 11:03 kgv Note Added: 0047466
2015-10-27 11:03 kgv Assigned To kgv => bugmaster
2015-10-27 11:03 kgv Status resolved => reviewed
2015-10-27 13:52 mkv Assigned To bugmaster => mkv
2015-10-28 15:19 mkv Note Added: 0047538
2015-10-28 15:20 mkv Note Added: 0047539
2015-10-28 15:20 mkv Assigned To mkv => rkv
2015-10-28 15:20 mkv Status reviewed => assigned
2015-10-28 15:20 mkv Test case number => Not needed
2015-10-29 10:41 git Note Added: 0047574
2015-10-29 10:48 git Note Added: 0047578
2015-10-29 10:55 git Note Added: 0047580
2015-10-29 10:56 rkv Assigned To rkv => kgv
2015-10-29 10:56 rkv Status assigned => resolved
2015-11-05 12:19 kgv Note Added: 0047803
2015-11-05 12:19 kgv Assigned To kgv => msv
2015-11-05 12:19 kgv Status resolved => feedback
2015-11-05 16:00 msv Note Added: 0047832
2015-11-05 16:00 msv Assigned To msv => bugmaster
2015-11-05 16:00 msv Status feedback => reviewed
2015-11-05 16:02 kgv Note Added: 0047833
2015-11-05 16:09 git Note Added: 0047835
2015-11-05 16:09 kgv Note Added: 0047836
2015-11-05 16:10 msv Note Added: 0047837
2015-11-05 16:15 kgv Note Added: 0047838
2015-11-05 16:16 mkv Assigned To bugmaster => mkv
2015-11-05 16:39 git Note Added: 0047843
2015-11-05 19:27 kgv Note Added: 0047848
2015-11-08 19:15 abv Note Added: 0047922
2015-11-08 19:16 git Note Added: 0047923
2015-11-09 07:49 abv Relationship added related to 0026854
2015-11-09 14:35 mkv Note Added: 0047952
2015-11-09 14:35 mkv Assigned To mkv => abv
2015-11-09 14:35 mkv Status reviewed => assigned
2015-11-09 15:59 abv Note Added: 0047957
2015-11-09 15:59 abv Assigned To abv => kgv
2015-11-09 15:59 abv Status assigned => resolved
2015-11-09 16:48 abv Assigned To kgv => bugmaster
2015-11-09 16:48 abv Status resolved => reviewed
2015-11-09 17:04 mkv Assigned To bugmaster => mkv
2015-11-13 11:53 abv Changeset attached => occt master 3d18f1e0
2015-11-13 11:53 abv Assigned To mkv => abv
2015-11-13 11:53 abv Status reviewed => verified
2015-11-13 11:53 abv Resolution open => fixed
2016-04-17 14:23 git Note Added: 0053151
2016-04-17 14:23 git Note Added: 0053152
2016-04-17 14:23 git Note Added: 0053153
2016-04-20 15:42 aiv Fixed in Version => 7.0.0
2016-04-20 15:51 aiv Status verified => closed