View Issue Details

IDProjectCategoryView StatusLast Update
0024304Open CASCADEOCCT:Codingpublic2013-12-19 13:59
ReporterskiAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformLinuxOSDebian 4.0 
Product Version6.6.0 
Target Version6.7.0Fixed in Version6.7.0 
Summary0024304: Eliminate GCC compiler warning about exceeding maximum value for type in case label
DescriptionEliminate GCC compiler warning "case label value exceeds maximum value for type"
TagsNo tags attached.
Test case numberNot needed

Activities

abv

2013-11-18 06:33

manager   ~0026678

The current version actually disables signal handler in case if siginfo is not available. I believe existing implementation can be kept if this function is properly used as signal handler, since in this case it will always get signum as first argument (see docs on sigaction() et al.).

However, the current implementation of handlers is senseless: they are declared as class members while used as plain C functions (with explicit cast). I suggest that methods OSD::Handler(), OSD::SegvHandler(), OSD::WntHandler() should be removed from class members and made static const functions in CXX file, with signature as expected by sigaction() or other signal function used. This will allow using it without explicit cast, and protect against misuse.

Enum OSD_Signals should be removed as it is not used anywhere.

ski

2013-11-27 13:58

developer   ~0026959

Methods OSD::Handler(), OSD::SegvHandler(), OSD::WntHandler() were made static.
testing case bugs / fclasses / bug6143 is OK on the Debian6.0-64 and on Windows vc9 win32 release.
Testing on Windows vc9 win64 Debug is impossible due to bug 0024255.
Changes are located in branch CR24304.
Please, review.

abv

2013-11-27 14:23

manager   ~0026962

In OSD_SetSignal.cxx:

- switch by aSigInfo->si_code near lines 197 and 310, and if (fFltExceptions) on line 247: please keep action on separate line -- it is easier to see and to debug

- line 252: please remove "if (aSigInfo)" (artifact of previous fix), the switch should use theSigNum arument

- line 404: WntHandler() is not needed any more on Linux

- in all OSD_Signal*cxx: when pointer on signal handler function is used, please remove type cast and check that compiler does not complain

ski

2013-11-28 17:07

developer   ~0026986

Remarks were applied.
Also, type cast for function SIGWntHandler was removed, it seems that second argument is never used.
Changes are located in branch CR24304.
Please, review.

abv

2013-11-29 09:20

manager   ~0026990

I have restored FPE handlers and rebased on IR-2013-11-28; patch is ready for testing in branch CR24304_1. Please check compilation on Linux first of all.

mkv

2013-12-03 08:22

tester   ~0027034

Dear BugMaster,

Branch CR24304_1 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: 21403afd442ef0b60543b4407df8173bca5157fb

Number of compiler warnings:

occt component :
Linux: 101 (103 on master)
Windows: 0 (0 on master)

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

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 358043456 / 358548328
Total CPU difference: 42023.78000000015 / 45680.00000000018

Testing on Windows:
Total MEMORY difference: 413174476 / 412528388
Total CPU difference: 32482.046875 / 33996.0625

There are not differences in images found by testdiff.

Related Changesets

occt: master 89c4bca8

2013-11-28 14:10:25

ski


Committer: bugmaster Details Diff
0024304: Eliminate GCC compiler warning about exceeding maximum value for type in case label

Methods OSD::Handler(), OSD::SegvHandler(), OSD::WntHandler() were made static
Type cast were removed when pointer on signal handler function is used
Enumeration OSD_Signal removed
Affected Issues
0024304
mod - src/OSD/OSD.cdl Diff File
mod - src/OSD/OSD.cxx Diff File
mod - src/OSD/OSD_signal.cxx Diff File
mod - src/OSD/OSD_signal_WNT.cxx Diff File

Issue History

Date Modified Username Field Change
2013-10-31 16:21 ski New Issue
2013-10-31 16:21 ski Assigned To => ski
2013-10-31 16:22 ski Status new => assigned
2013-11-08 17:23 ski Assigned To ski => abv
2013-11-08 17:23 ski Status assigned => resolved
2013-11-18 06:33 abv Note Added: 0026678
2013-11-18 06:33 abv Assigned To abv => ski
2013-11-18 06:33 abv Status resolved => assigned
2013-11-27 13:58 ski Note Added: 0026959
2013-11-27 13:58 ski Assigned To ski => abv
2013-11-27 13:58 ski Status assigned => resolved
2013-11-27 14:23 abv Note Added: 0026962
2013-11-27 14:23 abv Assigned To abv => ski
2013-11-27 14:23 abv Status resolved => assigned
2013-11-28 17:07 ski Note Added: 0026986
2013-11-28 17:07 ski Assigned To ski => abv
2013-11-28 17:07 ski Status assigned => resolved
2013-11-29 09:20 abv Note Added: 0026990
2013-11-29 09:20 abv Assigned To abv => bugmaster
2013-11-29 09:20 abv Status resolved => reviewed
2013-11-29 11:25 mkv Assigned To bugmaster => mkv
2013-12-03 08:22 mkv Note Added: 0027034
2013-12-03 08:22 mkv Test case number => Not needed
2013-12-03 08:22 mkv Assigned To mkv => bugmaster
2013-12-03 08:22 mkv Status reviewed => tested
2013-12-06 17:57 bugmaster Changeset attached => occt master 89c4bca8
2013-12-06 17:57 bugmaster Status tested => verified
2013-12-06 17:57 bugmaster Resolution open => fixed
2013-12-09 12:04 bugmaster Target Version => 6.7.0
2013-12-19 13:50 bugmaster Status verified => closed
2013-12-19 13:59 bugmaster Fixed in Version => 6.7.0
2014-01-11 11:58 abv Category OCCT Release:BUILD => OCCT:Coding