home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
bbs
/
gnu
/
gcc-2.6.3-bin.lha
/
GNU
/
info
/
gcc.info-10
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-12-23
|
42KB
|
729 lines
This is Info file gcc.info, produced by Makeinfo-1.55 from the input
file gcc.texi.
This file documents the use and the internals of the GNU compiler.
Published by the Free Software Foundation 675 Massachusetts Avenue
Cambridge, MA 02139 USA
Copyright (C) 1988, 1989, 1992, 1993, 1994 Free Software Foundation,
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided also
that the sections entitled "GNU General Public License," "Funding for
Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
included exactly as in the original, and provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that the sections entitled "GNU General Public
License," "Funding for Free Software," and "Protect Your Freedom--Fight
`Look And Feel'", and this permission notice, may be included in
translations approved by the Free Software Foundation instead of in the
original English.
File: gcc.info, Node: External Bugs, Next: Incompatibilities, Prev: Interoperation, Up: Trouble
Problems Compiling Certain Programs
===================================
Certain programs have problems compiling.
* Parse errors may occur compiling X11 on a Decstation running
Ultrix 4.2 because of problems in DEC's versions of the X11 header
files `X11/Xlib.h' and `X11/Xutil.h'. People recommend adding
`-I/usr/include/mit' to use the MIT versions of the header files,
using the `-traditional' switch to turn off ANSI C, or fixing the
header files by adding this:
#ifdef __STDC__
#define NeedFunctionPrototypes 0
#endif
* If you have trouble compiling Perl on a SunOS 4 system, it may be
because Perl specifies `-I/usr/ucbinclude'. This accesses the
unfixed header files. Perl specifies the options
-traditional -Dvolatile=__volatile__
-I/usr/include/sun -I/usr/ucbinclude
-fpcc-struct-return
most of which are unnecessary with GCC 2.4.5 and newer versions.
You can make a properly working Perl by setting `ccflags' to
`-fwritable-strings' (implied by the `-traditional' in the
original options) and `cppflags' to empty in `config.sh', then
typing `./doSH; make depend; make'.
* On various 386 Unix systems derived from System V, including SCO,
ISC, and ESIX, you may get error messages about running out of
virtual memory while compiling certain programs.
You can prevent this problem by linking GNU CC with the GNU malloc
(which thus replaces the malloc that comes with the system). GNU
malloc is available as a separate package, and also in the file
`src/gmalloc.c' in the GNU Emacs 19 distribution.
If you have installed GNU malloc as a separate library package,
use this option when you relink GNU CC:
MALLOC=/usr/local/lib/libgmalloc.a
Alternatively, if you have compiled `gmalloc.c' from Emacs 19, copy
the object file to `gmalloc.o' and use this option when you relink
GNU CC:
MALLOC=gmalloc.o
File: gcc.info, Node: Incompatibilities, Next: Fixed Headers, Prev: External Bugs, Up: Trouble
Incompatibilities of GNU CC
===========================
There are several noteworthy incompatibilities between GNU C and most
existing (non-ANSI) versions of C. The `-traditional' option
eliminates many of these incompatibilities, *but not all*, by telling
GNU C to behave like the other C compilers.
* GNU CC normally makes string constants read-only. If several
identical-looking string constants are used, GNU CC stores only one
copy of the string.
One consequence is that you cannot call `mktemp' with a string
constant argument. The function `mktemp' always alters the string
its argument points to.
Another consequence is that `sscanf' does not work on some systems
when passed a string constant as its format control string or
input. This is because `sscanf' incorrectly tries to write into
the string constant. Likewise `fscanf' and `scanf'.
The best solution to these problems is to change the program to use
`char'-array variables with initialization strings for these
purposes instead of string constants. But if this is not possible,
you can use the `-fwritable-strings' flag, which directs GNU CC to
handle string constants the same way most C compilers do.
`-traditional' also has this effect, among others.
* `-2147483648' is positive.
This is because 2147483648 cannot fit in the type `int', so
(following the ANSI C rules) its data type is `unsigned long int'.
Negating this value yields 2147483648 again.
* GNU CC does not substitute macro arguments when they appear inside
of string constants. For example, the following macro in GNU CC
#define foo(a) "a"
will produce output `"a"' regardless of what the argument A is.
The `-traditional' option directs GNU CC to handle such cases
(among others) in the old-fashioned (non-ANSI) fashion.
* When you use `setjmp' and `longjmp', the only automatic variables
guaranteed to remain valid are those declared `volatile'. This is
a consequence of automatic register allocation. Consider this
function:
jmp_buf j;
foo ()
{
int a, b;
a = fun1 ();
if (setjmp (j))
return a;
a = fun2 ();
/* `longjmp (j)' may occur in `fun3'. */
return a + fun3 ();
}
Here `a' may or may not be restored to its first value when the
`longjmp' occurs. If `a' is allocated in a register, then its
first value is restored; otherwise, it keeps the last value stored
in it.
If you use the `-W' option with the `-O' option, you will get a
warning when GNU CC thinks such a problem might be possible.
The `-traditional' option directs GNU C to put variables in the
stack by default, rather than in registers, in functions that call
`setjmp'. This results in the behavior found in traditional C
compilers.
* Programs that use preprocessor directives in the middle of macro
arguments do not work with GNU CC. For example, a program like
this will not work:
foobar (
#define luser
hack)
ANSI C does not permit such a construct. It would make sense to
support it when `-traditional' is used, but it is too much work to
implement.
* Declarations of external variables and functions within a block
apply only to the block containing the declaration. In other
words, they have the same scope as any other declaration in the
same place.
In some other C compilers, a `extern' declaration affects all the
rest of the file even if it happens within a block.
The `-traditional' option directs GNU C to treat all `extern'
declarations as global, like traditional compilers.
* In traditional C, you can combine `long', etc., with a typedef
name, as shown here:
typedef int foo;
typedef long foo bar;
In ANSI C, this is not allowed: `long' and other type modifiers
require an explicit `int'. Because this criterion is expressed by
Bison grammar rules rather than C code, the `-traditional' flag
cannot alter it.
* PCC allows typedef names to be used as function parameters. The
difficulty described immediately above applies here too.
* PCC allows whitespace in the middle of compound assignment
operators such as `+='. GNU CC, following the ANSI standard, does
not allow this. The difficulty described immediately above
applies here too.
* GN