Data types – Crunch CRiSP File Editor 6 User Manual

Page 15

Advertising
background image

Page 15

ready for loading into CRiSP. The crunch program uses its own internal preprocessor which is very ANSI-C
like. By doing this gives the user more portability of macros and avoids common differences between
standard preprocessors.

Next the intermediate file is converted directly to the binary output file. Crunch has a number of switches:

-c

Compiles the source file to a .m file. This is useful for understanding the translation process
or to check for bugs in the compiler. If you have any problems understanding what crunch is
doing, then use this switch.

-Dvar

Used to #define constants before preprocessing. This switch is passed directly to the
preprocessor.

-f

Used to flush output during debugging. Causes the output to be written to the terminal. This
is useful if crunch core-dumps and you want to try and ascertain at what point during code
generation the problem is occurring.

-Ipath

Add a path to search for include files. This switch is passed directly to the preprocessor.

-g

Used to insert debugging information into the compiled code. This includes line number
information, so that when a macro error occurs, CRiSP can report the line in error.

-m

This is the make flag. Tests the modification time of the output file versus the source file and
only recompiles if it is necessary. This allows trivial makefiles to be built rather than having to
face the bugs in standard make. (See the distribution makefile how to use this).

For example, you can say:

crunch -m -o /macrodir *.cr

and only the out of date macro files will be recompiled. (No account is made of dependencies
on include files).

-n

Print out the names of files which would be compiled, but don't compile them. This flag is
useful with the '-m' (make) flag to verify what files will be recompiled.

-o file

Specifies the name of the output file to create. The file parameter can be the name of a
directory in which case the output file is put into the specified directory.

-p cpp

Used to specify the path of the C preprocessor to execute if the one on your system does not
conform to the standard used by the current Unix versions, e.g. if you are using Turbo C, or
you have a POSIX compliant C compiler.

-q

If more than one source file is specified on the command line, crunch normally prints the
name of each file as it is being compiled. This switch can be used to turn off this feature.

-S

Special non supported feature. Used to dump a symbol table.

-Uvar

Make the named variable undefined. Passed directly to the C pre-processor.

-V

Prints version number of compiler.

-#

Prints each pass of the compilation process as it proceeds.

The crunch compiler more or less understands the full ANSI C syntax, including structure definitions, bit
fields and typedefs. However, crunch is really only designed to accept macros which can be used by CRiSP.
At present CRiSP cannot handle structure and typedef definitions and so it is best to avoid these.

The crunch compiler normally creates a temporary intermediate file between the pre-processing stage and
the compilation phase. Normally this file is created in /tmp. You can override this by specifying the name of a
directory in either the CRTMP or TMP environment variable. (CRTMP will take precedence if both are
specified).

{button See Also, ALink(crunch,,,)}

Data types

CRiSP supports a range of primitive data types and complex objects. The following is a summary of the
basic data types:

Type

Description

Advertising