Skip to content

Using the C preprocessor

marksvc edited this page Jun 18, 2021 · 1 revision

Sometimes it is handy to look at C or C++ files after they have been run through the preprocessor. (Also some other files and programs use this, such as IDL or some of the SQL statement generation in Fieldworks. Both the commands below write to the standard output.

Windows

To use the preprocessor in Windows, the following command may be used:

 cl.exe /nologo /EP /E [-Iincludefile] input_file

Linux

To use the preprocessor in Linux, the following command may be used:

 ${CC-cc} -E -P -traditional -x c input_file

Also, there is a script in Fieldworks (Src/Sql/Scripts) that will run the above command and tidy up the output.

Clone this wiki locally