Compatibility With Other C Compilers
As noted above MSC 5.x with the Large Memory Model, Alternate Math
Library is the most compatible C compiler for use with Clipper Summer
'87 and 5.0x versions. This does not mean that other vendor's C
compilers can not be used with Clipper. But there are additional
limitations that must be observed when using these products. When I
started this article I wanted to demonstrate that non-MSC products
could be used with Clipper very effectively. Prior to working at
Nantucket, I had always used Turbo C, and was able to accomplish most
of what I wanted to do (using Summer '87 at that time.) By the time
I was done getting all the different products to compile and link -
resolving all the little problems - I began to really appreciate the
MSC compiler. If asked now, I think it is the only compiler I would
recommend for use with Clipper.
Table 1 shows the compatibility of some of the frequently asked about
C compilers, along with the compiler command line switches that
correspond to those recommended in the extend system documentation.
The two products below, however, defy this table's simple
categorization - so they are explained here in detail.
C++ Extensions
The way in which C++ implements method and operation overloading
is by using a mechanism referred to as "symbol table mangling".
This means that if you have three object classes that all have
a display() method, C++ changes the symbol for each version of
"display", into something that tells it which of the three
"display" methods it is referring to.
It is possible to produce compatible C++ functions by defining
the function as:
extern "C" CLIPPER func ( void )
This is a C++ declaration that tells the compiler not to
"mangle" the name. But since this turns the function name into
a normal "C" symbol, you can not have function overloading,
which limits their usefulness as C++ functions.
Microsoft C 6.0
Microsoft, with the introduction of MSC 6.0, has renamed some of
the math and stack checking functions calls so that the code
produced by the compiler is not backwardly compatible with MSC
5.x library code. The solution is to compile with the /Gh
switch - which produces 5.x compatible library calls - and then
link with the 5.x LLIBCA library (assuming you have a copy of
the MSC 5.x LLIBCA). If you do not have access to a 5.x
version of LLIBCA, you can contact Microsoft Technical Support
and ask for the "downgraded" (5.x compatible) library.
Also new in MSC 6.0 is the inclusion of a new compiler
optimization that uses "intrinsic" routines. These are
routines that the compiler resolves into in-line assembly code
instead of producing a call to the library function. Examples
of intrinsic functions are strcpy and strcmp. A list of
functions that can be resolved to intrinsic forms is contained
in Figure 1.
There are two ways to cause a function to be resolved to an
intrinsic: by using the compiler directive #pragma intrinsic(
<function>, ... ) or by compiling with the /Oi (optimize with
intrinsic forms) switch . If your C function uses only
intrinsic functions you do not have to link in the C library -
and would not suffer from the library incompatibility described
above.