C and C++


The QNX Compiler Models

CodeSonar provides two compiler models for the QNX C/C++ compiler: qcc and qpp.



Overview

The following file extensions are supported:

Compiler model Modeled native compiler Source file extensions
qcc QNX SDP C/C++ compiler (C interface) C: .c, .C, .i
C++: .cc, .cpp, .cxx, .c++, .ii
qpp QNX SDP C/C++ compiler (C++ interface) C: .c, .C, .i
C++: .cc, .cpp, .cxx, .c++, .ii

Availability

Platform Availability The qcc and qpp compiler models are available for all platforms.
Default Recognition/Handling By default, compilations are recognized and handled as follows.
Platform Native Compiler Model Used
All q++(.exe) qpp
All qcc(.exe) qcc
Specifying Additional Mappings If your compiler executable has a different name, specify a corresponding COMPILER_MODELS rule to map your executable name to the qcc or qpp model.

For full details of all native compilers recognized by CodeSonar by default, see section Compilers Recognized by CodeSonar.

Model Behavior

Model-Specific ABI Key Format The qcc and qpp and compiler models are transitively based on the gcc model, so you can associate an ABI key in the gcc-model-specific format with any compilation handled by these models. The key structure and interpretation are described in GNU Compiler Models: Model-Specific ABI Key Format.
Compilation Mode The modeled compilation mode depends on the modeled build command.
  • If -lang-c or -lang-c++ is specified, it will determine the compilation mode:
    • C if -lang-c is specified (without subsequent -lang-c++).
    • C++ if -lang-c++ is specified (without subsequent -lang-c).
  • Otherwise, the if the source file has a recognized extension, the compilation mode will be determined from the extension.
  • Otherwise, the compilation mode will depend on the model used:
    • C for the qcc model.
    • C++ for the qpp model).
C and C++ Standards The applicable C or C++ standard for the modeled compilation is determined exactly as it is for the clang model, described in Clang Compiler Models: C and C++ standards.
No CodeSonar Build If any of the following are specified, CodeSonar will ignore the compilation and will not generate any corresponding internal representation. If a CodeSonar project is based only on ignored compilations, it will have no contents and so will not be finalized.
Predefined Macros, Include Paths The predefined macros and include paths are obtained by invoking the native compiler in the modeled compilation mode.