arrow_back_ios Back to List
Helpful command line options
Offload KB - features
Old Content Alert
Please note that this is a old document archive and the will most likely be out-dated or superseded by various other products and is purely here for historical purposes.
In addition to the gcc and Offload-specific command line options the Offload compiler provides options to restrict certain C++ language features that have been found to cause problems in some situations.
- -cp_nocstylecasts C-style casts can cause problems on pointer to undefined structs (see blogpost for more information). This option makes the compiler issue an error message on encountering such casts. This option is useful to enforce coding guidelines that explicitly ban C-style casts.
- -cp_c2staticcasts Compiles C-style casts with restricted static_cast semantics. That means that C-style casts that are potentially dangerous are errored on by the compiler. This option is useful to find problematic C-style casts so that they can be replaced with safer C++ casts
- -cp_forcevirtual Enforces the 'virtual' keyword on overriding methods. If that option is specified the compiler issues an error message on silent overriders. This option can be useful to prevent accidental overriding.
Other command line options have been added to help diagnosing compile problems
- -cp_verbosemsg Verbose error messages (type locations etc). If that option is specified all error and warning messages that print type information will contain more information about the location of types in the source file, potential base classes etc. This option is very helpful when errors occur on very complex possibly templated class hierarchies.