View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0025725 | Open CASCADE | OCCT:Coding | public | 2015-01-20 11:53 | 2023-08-01 15:09 |
Reporter | Assigned To | ||||
Priority | normal | Severity | minor | ||
Status | new | Resolution | open | ||
Target Version | Unscheduled | ||||
Summary | 0025725: Avoid invocation of virtual methods in constructors and destructors | ||||
Description | Static code analyzers complain about multiple places where virtual method is called from constructor or destructor, which may result in behavior different from expected (own method will be called in all cases). More information: CAST report issue №628. | ||||
Tags | No tags attached. | ||||
Test case number | |||||
related to | 0025622 | closed | bugmaster | Open CASCADE | CAST analysis: Avoid invocation of virtual Methods of the declared Class in a Constructor or Destructor |
related to | 0025572 | closed | bugmaster | Open CASCADE | Remove MMgt_TShared class. |
parent of | 0027067 | closed | Open CASCADE | Avoid use of virtual methods for implementation of destructors in legacy classes |
|
Scan-build reports similar issues, see attached file scan-build-OCE.txt (against OCE; it is not complete, I forgot to build DRAWEXE). It may be more complete than CAST report, since scan-build is able to also detect virtual functions indirectly called by constructors/destructors. |
|
scan-build-OCE.txt (24,250 bytes) |
|
For the record, I tried to run scan-build for OCCT but it does not work for me (reports zero bugs). (Ubuntu 16.04 with CLang.) According to documentation, scan-build works by replacing compiler by its own wrapper by tweaking CXX make veriable; however, scripts generated by CMake does not use such variable. Direct path to compiler is encoded instead. For instance, in build folder/src/TKQADraw/CMakeFiles/TKQADraw.dir/build.make: src/TKQADraw/CMakeFiles/TKQADraw.dir/__/QABugs/QABugs.cxx.o: /home/abv/occt/src/QABugs/QABugs.cxx @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/abv/tmp/occt-clang/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object src/TKQADraw/CMakeFiles/TKQADraw.dir/__/QABugs/QABugs.cxx.o" cd /home/abv/tmp/occt-clang/src/TKQADraw && /usr/bin/clang $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/TKQADraw.dir/__/QABugs/QABugs.cxx.o -c /home/abv/occt/src/QABugs/QABugs.cxx |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-01-20 11:53 |
|
New Issue | |
2015-01-20 11:53 |
|
Assigned To | => azn |
2015-01-20 11:54 |
|
Description Updated | |
2015-01-20 11:54 |
|
Relationship added | related to 0025622 |
2015-01-20 11:55 |
|
Relationship added | related to 0025572 |
2015-01-20 11:56 |
|
Assigned To | azn => abv |
2015-01-20 14:35 | barbier | Note Added: 0036263 | |
2015-01-20 14:35 | barbier | File Added: scan-build-OCE.txt | |
2015-03-27 21:32 |
|
Target Version | 6.9.0 => 7.0.0 |
2015-12-14 22:44 |
|
Target Version | 7.0.0 => 7.1.0 |
2016-01-08 19:55 |
|
Relationship added | parent of 0027067 |
2016-01-08 19:59 |
|
Summary | Avoid invocation of virtual methods in a constructor and destructor of the Standard_Transient class inheritors. => Avoid invocation of virtual methods in constructors and destructors |
2016-01-08 19:59 |
|
Description Updated | |
2016-11-03 17:13 |
|
Target Version | 7.1.0 => 7.2.0 |
2017-07-20 12:29 | kgv | Target Version | 7.2.0 => 7.3.0 |
2018-02-25 21:04 |
|
Target Version | 7.3.0 => 7.4.0 |
2018-02-25 23:06 |
|
Note Added: 0074129 | |
2018-02-25 23:07 |
|
Note Edited: 0074129 | |
2019-07-10 19:27 |
|
Target Version | 7.4.0 => 7.5.0 |
2020-09-11 15:34 |
|
Target Version | 7.5.0 => 7.6.0 |
2021-09-20 10:09 | kgv | Target Version | 7.6.0 => 7.7.0 |
2022-08-17 12:01 | kgv | Target Version | 7.7.0 => 7.8.0 |
2023-08-01 15:09 | dpasukhi | Target Version | 7.8.0 => Unscheduled |