View Issue Details

IDProjectCategoryView StatusLast Update
0032650CommunityOCCT:Codingpublic2022-08-09 14:35
Reporterwaebbl Assigned Tokgv  
Status newResolutionopen 
Product Version7.5.3 
Target Version7.7.0 
Summary0032650: Coding Rules - QA warnings in 7.5.3
DescriptionOn Gentoo Linux we're getting a few QA warnings about null pointers being used:

* /var/tmp/portage/sci-libs/opencascade-7.5.3/work/occt-V7_5_3/src/GeomliteTest/GeomliteTest_API2dCommands.cxx:451:33: warning: ‘this’ pointer is null [-Wnonnull]
 * /var/tmp/portage/sci-libs/opencascade-7.5.3/work/occt-V7_5_3/src/GeomliteTest/GeomliteTest_API2dCommands.cxx:455:33: warning: ‘this’ pointer is null [-Wnonnull]
 * /var/tmp/portage/sci-libs/opencascade-7.5.3/work/occt-V7_5_3/src/ViewerTest/ViewerTest_ViewerCommands.cxx:8282:34: warning: ‘this’ pointer is null [-Wnonnull]
Steps To ReproduceNot sure how to reproduce on other Linux distros.
1. install required dependencies
2. add -frecord-gcc-switches to CFLAGS and -Wl,--defsym=__gentoo_check_ldflags__=0 to LDFLAGS. You might need to add additional warnings flags to CFLAGS to actually get the warnings.
3 run cmake -C /var/tmp/portage/sci-libs/opencascade-7.5.3/work/occt-V7_5_3_build/gentoo_common_config.cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_DOC_Overview=yes -DBUILD_Inspector=yes -DBUILD_WITH_DEBUG=no -DINSTALL_DIR_BIN=lib64/opencascade-7.5.3/bin -DINSTALL_DIR_CMAKE=lib64/cmake/opencascade-7.5.3 -DINSTALL_DIR_DOC=share/doc/opencascade-7.5.3 -DINSTALL_DIR_LIB=lib64/opencascade-7.5.3 -DINSTALL_DIR_SCRIPT=lib64/opencascade-7.5.3/bin -DINSTALL_DIR_WITH_VERSION=ON -DINSTALL_SAMPLES=yes -DINSTALL_TEST_CASES=NO -DUSE_D3D=NO -DUSE_FFMPEG=yes -DUSE_FREEIMAGE=no -DUSE_FREETYPE=ON -DUSE_GLES2=no -DUSE_RAPIDJSON=yes -DUSE_TBB=yes -DUSE_VTK=yes -DINSTALL_DOC_Overview=ON -D3RDPARTY_QT_DIR=/usr -DBUILD_SAMPLES_QT=ON -D3RDPARTY_VTK_DIR=/usr -D3RDPARTY_VTK_INCLUDE_DIR=/usr/include/vtk-9.0 -D3RDPARTY_VTK_LIBRARY_DIR=/usr/lib64 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/sci-libs/opencascade-7.5.3/work/occt-V7_5_3_build/gentoo_toolchain.cmake /var/tmp/portage/sci-libs/opencascade-7.5.3/work/occt-V7_5_3
4. run ninja or cmake --build
5. scan the logfiles for -Wnonnull entries

If you have access to a Gentoo Linux system:
1. add the entries for CFLAGS and LDFALGS from 2. above to /etc/portage/make.conf
2. run: USE="doc examples ffmpeg json tbb vtk" emerge =opencascade-7.5.3
3. The output above should be shown after emerge is finished.
Additional information
and documentation updates
The package builds and installs without errors, although I didn't do any runtime testing or testing with applications using the library.
See also: and the attached build log. The warning starts at line 18119
TagsNo tags attached.
Test case number

Attached Files

  • opencascade-7.5.3:20211021-154330.log (7,699,284 bytes)


related to 0032640 closedsmoskvin Community Coding Rules - fix misprints in GeomliteTest_API2dCommands.cxx 
related to 0032676 verifiedsmoskvin Open CASCADE Draw Harness, ViewerTest - fix NULL dereference on vanim -remove 
related to 0033097 newkgv Community Coding Rules - New QA warnings in 7.6.3 



2021-11-05 16:42


opencascade-7.5.3:20211021-154330.log (7,699,284 bytes)


2021-11-05 20:51

developer   ~0105051

Last edited: 2021-11-05 20:52

These 3 warnings should be fixed by 0032640 and included into OCCT 7.6.0.

Could you run the build for 7.6.0 and check if they are fixed / nothing new reported?


2021-12-11 10:34

reporter   ~0105799

The first two are fixed in 7.6.0, the last warning ViewerTest_ViewerCommands.cxx is still showing, but on a different line: 7193


2021-12-11 11:54

developer   ~0105814

@waebbl, I think the last one should be fixed by 0032676. Which OCCT version you have checked (the last fix is not in OCCT 7.6.0)?


2021-12-11 14:53

reporter   ~0105815

@kgv I checked with 7.6.0


2022-03-12 17:43

reporter   ~0107267

With 7.6.1, the first two warnings no longer show up, but the last one's still there.


2022-03-12 17:48

developer   ~0107268

> With 7.6.1, the first two warnings no longer show up, but the last one's still there.
This is because 0032676 targets OCCT 7.7.0, not 7.6.x

Issue History

Date Modified Username Field Change
2021-11-05 16:42 waebbl New Issue
2021-11-05 16:42 waebbl Assigned To => kgv
2021-11-05 16:42 waebbl File Added: opencascade-7.5.3:20211021-154330.log
2021-11-05 20:31 kgv Relationship added related to 0032640
2021-11-05 20:45 kgv Summary QA warnings in 7.5.3 => Coding Rules - QA warnings in 7.5.3
2021-11-05 20:51 kgv Note Added: 0105051
2021-11-05 20:52 kgv Note Edited: 0105051
2021-12-11 10:34 waebbl Note Added: 0105799
2021-12-11 11:53 kgv Relationship added related to 0032676
2021-12-11 11:54 kgv Note Added: 0105814
2021-12-11 11:54 kgv Target Version => 7.7.0
2021-12-11 14:53 waebbl Note Added: 0105815
2022-03-12 17:43 waebbl Note Added: 0107267
2022-03-12 17:48 kgv Note Added: 0107268
2022-08-09 14:35 kgv Relationship added related to 0033097