Main Content

Fix Polyspace Compilation Errors Related to Texas Instruments Compilers

Issue

The Texas Instruments® compilers impose a nonstandard requirement on folder sequences in the include file search path, which is not directly supported by the Polyspace® project creation mechanism from build systems (using the polyspace-configure command).

As a result, if you create a Polyspace project from a build that uses a Texas Instruments compiler, after starting an analysis on the project, you might see the warning:

warning: could not find include file "stddef.h"
|  #include_next <stddef.h>
|                          

Possible Solutions

The Texas Instruments compilers impose a certain order of include folders in the include file search path. In particular, the compilers require the implicitly specified libcxx subfolder of the compiler include folder to precede explicit subfolders in the include file search path. When you create a Polyspace project or options file by tracing a build command, the project or options file contains an include folder sequence where the implicitly included libcxx subfolder comes after explicit subfolders. As a result, include_next lines in files in the libcxx subfolder, which only use later include folders in the search path for include file lookup, fail to find the included files.

To work around the problem:

  1. In your Polyspace project or options file, locate the -I options that point to libcxx subfolders. They will appear in lines starting with -options-for-sources, for instance:

    -options-for-sources sourcefile.c;-I some_explicitly_included_folder;-I compiler_include_folder\libcxx; 

  2. For each such -options-for-sources line, switch the order of the -I-s so that the libcxx subfolder appears first, for instance:

    -options-for-sources sourcefile.c;-I compiler_include_folder\libcxx;-I some_explicitly_included_folder;

See Also

| | |