Main Content

Green Hills Compiler (-compiler greenhills)

Specify Green Hills compiler

Description

Specify greenhills for Compiler (-compiler) if you compile your code using a Green Hills® compiler. By specifying your compiler, you can avoid compilation errors from syntax that is not part of the Standard but comes from language extensions.

Then, specify your target processor type. If you select greenhills for Compiler, in the user interface of the Polyspace® desktop products, you see only the processors allowed for a Green Hills compiler. Your choice of target processor determines the size of fundamental data types, the endianness of the target machine and certain keyword definitions.

If you specify the greenhills compiler, you must specify the path to your compiler header files. See Provide Standard Library Headers for Polyspace Analysis.

Settings

The targets use the following default sizes in bits for the fundamental types. You do not see these sizes in the user interface of the Polyspace desktop products.

Targetcharshortintlonglong longfloatdoublelong doubleptrDefault sign of charEndiannessAlignmentDefinition of size_tDefinition of wchar_t
powerpc81632326432646432unsignedBig64unsigned intlong
powerpc6481632646432646464unsignedBig64unsigned longint
arm81632326432646432unsignedLittle32unsigned intunsigned short
arm6481632646432646464unsignedLittle64unsigned longint
tricore81632326432646432signedLittle32unsigned intunsigned int
rh85081632326432646432signedLittle64unsigned intlong
i38681632326432649632signedLittle32unsigned intlong
x86_64816326464326412864signedLittle128unsigned longint

Your compiler specification also determines the values of many compiler-specific macros. In case you want to know how Polyspace defines a specific macro, use the option -dump-preprocessing-info.

Tips

  • If you encounter errors during a Polyspace analysis, see Fix Polyspace Compilation Errors Related to Green Hills Compiler

  • Polyspace supports the embedded configuration for the i386 target. If your x86 Green Hills compiler is configured for native Windows® development, you can see compilation errors or incorrect analysis results with Code Prover. Contact Technical Support.

    For instance, Green Hills compilers consider a size of 12 bytes for long double for embedded targets, but 8 bytes for native Windows. Polyspace considers 12 bytes by default.

  • If you create a Polyspace project from a build command that uses a Green Hills compiler, the compiler option -os_dir is not implemented in the project. To emulate the -os_dir option, you can explicitly add the path argument of the option as an include folder to your Polyspace project.

  • If you use Polyspace as You Code extensions in IDEs, enter this option in an analysis options file. See options file.

Command-Line Information

Parameter: -compiler greenhills -target
Value: powerpc | powerpc64 | arm | arm64 | tricore | rh850 | arm | i386 | x86_64
Default: powerpc
Example (Bug Finder): polyspace-bug-finder -compiler greenhills -target arm
Example (Code Prover): polyspace-code-prover -compiler greenhills -target arm
Example (Bug Finder Server): polyspace-bug-finder-server -compiler greenhills -target arm
Example (Code Prover Server): polyspace-code-prover-server -compiler greenhills -target arm

Version History

Introduced in R2017b

expand all