thliebig / openEMS

openEMS is a free and open-source electromagnetic field solver using the EC-FDTD method.
http://openEMS.de
GNU General Public License v3.0
427 stars 150 forks source link

clang-11 prints a lot of: warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true #76

Closed yurivict closed 3 years ago

yurivict commented 3 years ago
/usr/local/include/CSXCAD/CSPrimitives.h:151:40: warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true [-Wundefined-bool-conversion]
        CSPrimRotPoly* ToRotPoly() { return ( this && Type == ROTPOLY ) ? (CSPrimRotPoly*) this : 0; } /// Cast Primitive to a more defined type. Will return null if not of the requested type.
                                              ^~~~ ~~
thliebig commented 3 years ago

Yeah I guess this is not necessary, but this is an issue of CSXCAD not openEMS. I'm looking forward to your pull request fixing this ;)