You see, with No_Exception there is no check for array bounds in the method Value.
02Author
Thanks for the responses.
What I have observed with the "NO_CXX_EXCEPTION" flag if removed
from the 'Makefile' in the compiler flags, then the
try/catch of OCC 'Standard_failure' for various API's
works successfully.
What I mean is OCC API 'Standard_COnstructuionError' is
caught and thrown.
03Commenter-1
Without NO_CXX_EXCEPTION on Linux you will face serious problems with catching system signals such as SIGSEGV, SIGFPE, etc., when using OSD::SetSignal method to redirect signals.
But, since OCC6.2 a new mechanism appeared that is initiated with the definition OCC_CONVERT_SIGNALS instead of NO_CXX_EXCEPTION, and it seams to be more safe as it uses the native C++ try/catch and thus unwinds all objects on the stack during treatment of any exception or signal.
To use any of these mechanisms you need to include the header Standard_ErrorHandler.hxx in any source file containing try/catch clauses, and additionally to use the last mechanism you need to insert OCC_CATCH_SIGNALS macro just after each 'try' clause. For example, see any OCC source file containg 'try'.
04Author
Hello all,
Anybody can share a makefile with latest/new compiler flags for Linux/windows.
thanks in advance
- PG
05Commenter-2
The ones of the form -Dfoo are equivalent to doing "#define foo" in the source. Most of them are OpenCascade-specific. -DNDEBUG removes all "assert" statements from the code.
The -W flags enable/disable warnings.
-O3 is an optimization level.
-fPIC requests position-independent code, typically for shared libraries.
-funsignned-char presumably does exactly what it says: makes "char" and unsigned type [0,255] rather than a signed type [-128,127].
06Commenter-2
The ones of the form -Dfoo are equivalent to doing "#define foo" in the source. Most of them are OpenCascade-specific. -DNDEBUG removes all "assert" statements from the code.
The -W flags enable/disable warnings.
-O3 is an optimization level.
-fPIC requests position-independent code, typically for shared libraries.
-funsignned-char presumably does exactly what it says: makes "char" and unsigned type [0,255] rather than a signed type [-128,127].
But to answer your actual question: to get documentation on the g++ compiler flags try the command "man g++", or "info g++". As for the OpenCascade-specific preprocessor defines, you'll probably have to search the source for the places where they are used.