home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
EFFO
/
forum7.lzh
/
RICO
/
C
/
CONFIG
/
readme
< prev
Wrap
Text File
|
2009-11-06
|
2KB
|
45 lines
config.c - a C configuration enquirer
Author: Steven Pemberton, CWI, Amsterdam
This program determines properties of your machine and C compiler, such as
the number of bits used for certain data-types, the accuracy of float and
double, and so on.
The original purpose of the program was to generate a header-file for a
large piece of software that must be as portable as possible. However, it is
also a good check for a new compiler. It is the descendent of a similar
program I posted a year or so ago. However it is completely rewritten, and
incorporates much experience with the use of that program, and ideas from
users of it.
The program only works if overflows are ignored by the C system or are
catchable by signal().
If your C system is not unix but does have signal/setjmp, compile with
cc -DSIGNAL config.c
otherwise with
cc config.c
Don't use any optimisation flags.
Some compilers need a -f flag for floating point.
You may need to add some calls to signal() for other sorts of exception on
your machine than SIGFPE, and SIGOVER. See lines beginning #ifdef SIGNAL
later in the program.
Output is produced as C style comments so that the program can be used to
produce a .h file with minimum upheaval.
I apologise unreservedly for the contorted use of the preprocessor...
If your C preprocessor doesn't have the predefined __FILE__ macro, and you
want to call the file anything other than config.c, change the first
#define command accordingly.
Any ideas for future enhancements, and all fixes to make it run on machines
where it doesn't currently run, will be gratefully received. Please mail me
at
steven@cwi.nl (new style) or seismo!mcvax!steven (old style)
Steven Pemberton, Centre for Mathematics and Computer Science
Amsterdam, The Netherlands