Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Unable to find "stdlib.h" during stub generation

Options
spreskitt
spreskitt Posts: 1

Hi all,
I'm currently working on a modification to some Linux kernel code, and while I've been able to generate a BDF for the entire kernel and can perform static analysis on my new/changed files without a problem, I can't seem to either generate stubs or run unit tests on the affected files (in file scope). For instance, generating stubs gives the following:

Starting "Generate Stubs (File Scope)" (Execution) for /new_nfsd ...

Collecting tests to be executed...
...done.
Preparing execution flow...
Finding test cases...
...done.
[newfile.c] Precompiling source: /new_nfsd/linux-4.12.10/fs/nfsd/newfile.c ...
[newfile.c] ...result is up-to-date.
Appending included test cases for: /new_nfsd/linux-4.12.10/fs/nfsd/newfile.c ...
...done.
[newfile.c] Preparing instrumentation for: /new_nfsd/linux-4.12.10/fs/nfsd/newfile.c ...
[bundled_newfile.c] Checking dependencies for /home/username/Parasoft/cpptest/10.4/workspace/.cpptest/new_nfsd/file-data/newfile.ce80342b6/bundled_newfile.c ...
[bundled_newfile.c] In file included from /home/username/parasoft/cpptest/10.4/engine/runtime/include/cpptest_common.h:19:0,
                 from /home/username/parasoft/cpptest/10.4/engine/runtime/include/cpptest_runtime_u.h:10,
                 from /home/username/parasoft/cpptest/10.4/engine/runtime/include/cpptest.h:10,
                 from /home/username/Parasoft/cpptest/10.4/workspace/.cpptest/new_nfsd/file-data/newfile.ce80342b6/bundled_newfile.c:1:
/home/username/parasoft/cpptest/10.4/engine/runtime/include/cpptest_headers.h:43:24: **fatal error: stdlib.h: No such file or directory
 #define CPPTEST_stdlib <stdlib.h>**
                        ^
compilation terminated.

There are more error listings afterwards having to do with the "stdlib.h" include not being found, but I believe this gets the gist of the problem across. The compiler in use is gcc 7.4.0, and the kernel being compiled is 4.12.10. I've also tried explicitly placing the appropriate include directories as a compiler command-line flag in the project properties, but that makes no difference. Any idea what I might be doing wrong here? Thanks!