Archived issue #0032460

Coding Rules - eliminate CLang warning -Wunused-but-set-variable

Open CASCADEOCCT:Codingclosed5 public notes

Search issues

Description

Emscripten SDK 2.0.24 generates the following warnings that should be eliminated:
---
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 2.0.24 ([revision removed])
---
shared:INFO: (Emscripten: Running sanity checks)
\occt.git\src\ProjLib\ProjLib_ComputeApproxOnPolarSurface.cxx:814:24: warning: variable 'nbK2d' set but not used [-Wunused-but-set-variable]
      Standard_Integer nbK2d, deg;
                       ^
1 warning generated.
\occt.git\src\MeshVS\MeshVS_NodalColorPrsBuilder.cxx:226:22: warning: variable 'aNbLinkPrimitives' set but not used [-Wunused-but-set-variable]
    Standard_Integer aNbLinkPrimitives = 0;
                     ^
1 warning generated.
\occt.git\src\XmlMDF\XmlMDF.cxx:168:20: warning: variable 'count' set but not used [-Wunused-but-set-variable]
  Standard_Integer count = 0;
                   ^
1 warning generated.
\occt.git\src\Standard\Standard_MMgrOpt.cxx:530:31: warning: variable 'nPoolFreed' set but not used [-Wunused-but-set-variable]
  Standard_Integer nPool = 0, nPoolFreed = 0;
                              ^
\occt.git\src\Standard\Standard_MMgrOpt.cxx:530:20: warning: variable 'nPool' set but not used [-Wunused-but-set-variable]
  Standard_Integer nPool = 0, nPoolFreed = 0;
                   ^
2 warnings generated.
In file included from \occt.git\src\HLRBRep\HLRBRep_TheIntPCurvePCurveOfCInter_0.cxx:41:
In file included from \occt.git/work/occt-wasm32-make/inc\IntCurve_IntPolyPolyGen.gxx:1:
\occt.git/src/IntCurve/IntCurve_IntPolyPolyGen.gxx:239:20: warning: variable 'PosSegment' set but not used [-Wunused-but-set-variable]
  Standard_Integer PosSegment = 0;
                   ^
1 warning generated.
\occt.git\src\AppCont\AppCont_LeastSquare.cxx:42:23: warning: variable 'i2' set but not used [-Wunused-but-set-variable]
  Standard_Integer j, i2;
                      ^
1 warning generated.
\occt.git\src\IntPatch\IntPatch_ImpPrmIntersection.cxx:1978:63: warning: variable 'DDV' set but not used [-Wunused-but-set-variable]
  Standard_Real Uc = 0., Vc = 0., Un = 0., Vn = 0., DDU = 0., DDV = 0.;
                                                              ^
1 warning generated.
\occt.git\src\BRepTest\BRepTest_BasicCommands.cxx:214:20: warning: variable 'last' set but not used [-Wunused-but-set-variable]
  Standard_Integer last = n;
                   ^
1 warning generated.
In file included from \occt.git\src\Geom2dInt\Geom2dInt_TheIntPCurvePCurveOfGInter_0.cxx:42:
In file included from \occt.git/work/occt-wasm32-make/inc\IntCurve_IntPolyPolyGen.gxx:1:
\occt.git/src/IntCurve/IntCurve_IntPolyPolyGen.gxx:239:20: warning: variable 'PosSegment' set but not used [-Wunused-but-set-variable]
  Standard_Integer PosSegment = 0;
                   ^
1 warning generated.
\occt.git\src\AdvApp2Var\AdvApp2Var_SysBase.cxx:863:19: warning: parameter 'ct' set but not used [-Wunused-but-set-parameter]
             const char *ct, 
                         ^
1 warning generated.
\occt.git\src\GeomPlate\GeomPlate_BuildPlateSurface.cxx:1538:24: warning: variable 'Npt' set but not used [-Wunused-but-set-variable]
      Standard_Integer Npt=0;
                       ^
\occt.git\src\GeomPlate\GeomPlate_BuildPlateSurface.cxx:2421:35: warning: variable 'SdiffDist' set but not used [-Wunused-but-set-variable]
      Standard_Real diffDistMax=0,SdiffDist=0;
                                  ^
\occt.git\src\GeomPlate\GeomPlate_BuildPlateSurface.cxx:2422:34: warning: variable 'SdiffAng' set but not used [-Wunused-but-set-variable]
      Standard_Real diffAngMax=0,SdiffAng=0;
                                 ^
3 warnings generated.
em++: warning: linker setting ignored during compilation: 'WASM' [-Wunused-command-line-argument]
em++: warning: linker setting ignored during compilation: 'MAX_WEBGL_VERSION' [-Wunused-command-line-argument]
em++: warning: linker setting ignored during compilation: 'ALLOW_MEMORY_GROWTH' [-Wunused-command-line-argument]
em++: warning: linker setting ignored during compilation: 'TOTAL_MEMORY' [-Wunused-command-line-argument]
em++: warning: EXTRA_EXPORTED_RUNTIME_METHODS is deprecated, please use EXPORTED_RUNTIME_METHODS instead [-Wdeprecated]
Building time: 00:14:42
Total building time: 00:15:41
Install time: 00:01:11
Total time: 00:16:53

Steps to reproduce

N/A

Public activity

5 archived notes

Participants are labeled by their role within this record.

01Commenter 1
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Thu Jun 24 23:07:37 2021 +0300

    0032460: Coding Rules - eliminate CLang warning -Wunused-but-set-variable
02Commenter 1
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
03Author
Please raise the patch
- OCCT: branch CR32460 (rebased onto current WEEK).

http://jenkins-test-12.nnov.opencascade.com:8080/view/CR32460-master-KGV/
04Commenter 2
Combination -
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17457.040000000452 / 17401.81000000044 [+0.32%]
Products
Total CPU difference: 11511.540000000101 / 11508.180000000091 [+0.03%]
Windows-64-VC14:
OCCT
Total CPU difference: 19236.53125 / 19191.4375 [+0.23%]
Products
Total CPU difference: 12832.328125 / 12883.6875 [-0.40%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
05Commenter 1
Branch [archived branch] has been deleted by Participant.

[revision removed]