When processing a project for the first time, Cscout may terminate its processing with a syntax error. The errors are typically occurring because of incompatibilities between CScout and C compiler extensions or features of a particular version of the C Standard used in the project. Here is advice for troubleshooting such errors.
include/template
directory, and reinstall CScout.
Look within the existing header files for examples of how diverse
compiler extensions are handled.
If the fix is general and widely applicable, please consider
contributing it back via a GitHub pull request.
#if !defined(__CSCOUT__)
conditional compilation directive.
#pragma process
directive of the employed CScout
processing script.
cscout -E /path/to/file.c main.cs >file.i
.
#pragma process
directives for header
files, as in the example below, then the above method will not work.
#include "/usr/local/include/cscout/csmake-post-defs.h" #pragma process "[...]/include/linux/kconfig.h" #pragma process "[...]/init/do_mounts_rd.c"In this case, employ the cscut command to extract from the processing script the part associated with the offending file (e.g. into a file named
file.cs
),
and then run CScout in preprocessing mode on that file:
cscout -E . file.cs >file.i
#pragma block_enter #pragma block_enter #pragma process "file.i" #pragma block_exit #pragma block_exit
cscout -P
command to process only the parts
of the processing script associated with the offending file.
This will allow you to iterate through possible fixes and test them,
without waiting for CScout to process all other files.
As described above, if the processing
script contains #pragma process
directives for header
files use cscut to extract the script part for the offending
file, and only process this.
cscut -e
command or by deleting the processed parts with your editor.
When modifying the processing script by hand,
be careful not to violate the project and file block nestings.
You can remove the processing of entire projects (an outward
#pragma block_enter / block_exit
block) or entire
files (an inward #pragma block_enter / block_exit
),
but you should never leave incomplete blocks.