home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / gcc-2.5.8-bin.lha / info / gcc.info-6 (.txt) < prev    next >
GNU Info File  |  1994-02-21  |  51KB  |  915 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.55 from the input
  2. file gcc.texi.
  3.    This file documents the use and the internals of the GNU compiler.
  4.    Published by the Free Software Foundation 675 Massachusetts Avenue
  5. Cambridge, MA 02139 USA
  6.    Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
  7.    Permission is granted to make and distribute verbatim copies of this
  8. manual provided the copyright notice and this permission notice are
  9. preserved on all copies.
  10.    Permission is granted to copy and distribute modified versions of
  11. this manual under the conditions for verbatim copying, provided also
  12. that the sections entitled "GNU General Public License" and "Protect
  13. Your Freedom--Fight `Look And Feel'" are included exactly as in the
  14. original, and provided that the entire resulting derived work is
  15. distributed under the terms of a permission notice identical to this
  16.    Permission is granted to copy and distribute translations of this
  17. manual into another language, under the above conditions for modified
  18. versions, except that the sections entitled "GNU General Public
  19. License" and "Protect Your Freedom--Fight `Look And Feel'", and this
  20. permission notice, may be included in translations approved by the Free
  21. Software Foundation instead of in the original English.
  22. File: gcc.info,  Node: Build Cross,  Prev: Cross Runtime,  Up: Cross-Compiler
  23. Actually Building the Cross-Compiler
  24. ------------------------------------
  25.    Now you can proceed just as for compiling a single-machine compiler
  26. through the step of building stage 1.  If you have not provided some
  27. sort of `libgcc1.a', then compilation will give up at the point where
  28. it needs that file, printing a suitable error message.  If you do
  29. provide `libgcc1.a', then building the compiler will automatically
  30. compile and link a test program called `cross-test'; if you get errors
  31. in the linking, it means that not all of the necessary routines in
  32. `libgcc1.a' are available.
  33.    If you are making a cross-compiler for an embedded system, and there
  34. is no `stdio.h' header for it, then the compilation of `enquire' will
  35. probably fail.  The job of `enquire' is to run on the target machine
  36. and figure out by experiment the nature of its floating point
  37. representation.  `enquire' records its findings in the header file
  38. `float.h'.  If you can't produce this file by running `enquire' on the
  39. target machine, then you will need to come up with a suitable `float.h'
  40. in some other way (or else, avoid using it in your programs).
  41.    Do not try to build stage 2 for a cross-compiler.  It doesn't work to
  42. rebuild GNU CC as a cross-compiler using the cross-compiler, because
  43. that would produce a program that runs on the target machine, not on the
  44. host.  For example, if you compile a 386-to-68030 cross-compiler with
  45. itself, the result will not be right either for the 386 (because it was
  46. compiled into 68030 code) or for the 68030 (because it was configured
  47. for a 386 as the host).  If you want to compile GNU CC into 68030 code,
  48. whether you compile it on a 68030 or with a cross-compiler on a 386, you
  49. must specify a 68030 as the host when you configure it.
  50.    To install the cross-compiler, use `make install', as usual.
  51. File: gcc.info,  Node: PA Install,  Next: Sun Install,  Prev: Cross-Compiler,  Up: Installation
  52. Installing on the HP Precision Architecture
  53. ===========================================
  54.    There are two variants of this CPU, called 1.0 and 1.1, which have
  55. different machine descriptions.  You must use the right one for your
  56. machine.  All 7NN machines and 8N7 machines use 1.1, while all other
  57. 8NN machines use 1.0.
  58.    The easiest way to handle this problem is to use `configure hpNNN'
  59. or `configure hpNNN-hpux', where NNN is the model number of the
  60. machine.  Then `configure' will figure out if the machine is a 1.0 or
  61. 1.1.  Use `uname -a' to find out the model number of your machine.
  62.    `-g' does not work on HP-UX, since that system uses a peculiar
  63. debugging format which GNU CC does not know about.  There are
  64. preliminary versions of GAS and GDB for the HP-PA which do work with
  65. GNU CC for debugging.  You can get them by anonymous ftp from
  66. `jaguar.cs.utah.edu' `dist' subdirectory.  You would need to install
  67. GAS in the file
  68.      /gnu/lib/gcc-lib/CONFIGURATION/GCCVERSION/as
  69. where CONFIGURATION is the configuration name (perhaps `hpNNN-hpux')
  70. and GCCVERSION is the GNU CC version number.  Do this *before* starting
  71. the build process, otherwise you will get errors from the HPUX
  72. assembler while building `libgcc2.a'.  The command
  73.      make install-dir
  74. will create the necessary directory hierarchy so you can install GAS
  75. before building GCC.
  76.    If you obtained GAS before October 6, 1992 it is highly recommended
  77. you get a new one to avoid several bugs which have been discovered
  78. recently.
  79.    To enable debugging, configure GNU CC with the `--gas' option before
  80. building.
  81.    It has been reported that GNU CC produces invalid assembly code for
  82. 1.1 machines running HP-UX 8.02 when using the HP assembler.  Typically
  83. the errors look like this:
  84.      as: bug.s @line#15 [err#1060]
  85.        Argument 0 or 2 in FARG upper
  86.               - lookahead = ARGW1=FR,RTNVAL=GR
  87.      as: foo.s @line#28 [err#1060]
  88.        Argument 0 or 2 in FARG upper
  89.               - lookahead = ARGW1=FR
  90.    You can check the version of HP-UX you are running by executing the
  91. command `uname -r'.   If you are indeed running HP-UX 8.02 on a PA and
  92. using the HP assembler then configure GCC with "hpNNN-hpux8.02".
  93. File: gcc.info,  Node: Sun Install,  Next: 3b1 Install,  Prev: PA Install,  Up: Installation
  94. Installing GNU CC on the Sun
  95. ============================
  96.    On Solaris (version 2.1), do not use the linker or other tools in
  97. `/usr/ucb' to build GNU CC.  Use `/usr/ccs/bin'.
  98.    Make sure the environment variable `FLOAT_OPTION' is not set when
  99. you compile `libgcc.a'.  If this option were set to `f68881' when
  100. `libgcc.a' is compiled, the resulting code would demand to be linked
  101. with a special startup file and would not link properly without special
  102. pains.
  103.    The GNU compiler does not really support the Super SPARC processor
  104. that is used in SPARC Station 10 and similar class machines.  You can
  105. get code that runs by specifying `sparc' as the cpu type; however, its
  106. performance is not very good, and may vary widely according to the
  107. compiler version and optimization options used.  This is because the
  108. instruction scheduling parameters designed for the Sparc are not correct
  109. for the Super SPARC.  Implementing scheduling parameters for the Super
  110. SPARC might be a good project for someone who is willing to learn a
  111. great deal about instruction scheduling in GNU CC.
  112.    There is a bug in `alloca' in certain versions of the Sun library.
  113. To avoid this bug, install the binaries of GNU CC that were compiled by
  114. GNU CC.  They use `alloca' as a built-in function and never the one in
  115. the library.
  116.    Some versions of the Sun compiler crash when compiling GNU CC.  The
  117. problem is a segmentation fault in cpp.  This problem seems to be due to
  118. the bulk of data in the environment variables.  You may be able to avoid
  119. it by using the following command to compile GNU CC with Sun CC:
  120.      make CC="TERMCAP=x OBJS=x LIBFUNCS=x STAGESTUFF=x cc"
  121. File: gcc.info,  Node: 3b1 Install,  Next: Unos Install,  Prev: Sun Install,  Up: Installation
  122. Installing GNU CC on the 3b1
  123. ============================
  124.    Installing GNU CC on the 3b1 is difficult if you do not already have
  125. GNU CC running, due to bugs in the installed C compiler.  However, the
  126. following procedure might work.  We are unable to test it.
  127.   1. Comment out the `#include "config.h"' line on line 37 of `cccp.c'
  128.      and do `make cpp'.  This makes a preliminary version of GNU cpp.
  129.   2. Save the old `/lib/cpp' and copy the preliminary GNU cpp to that
  130.      file name.
  131.   3. Undo your change in `cccp.c', or reinstall the original version,
  132.      and do `make cpp' again.
  133.   4. Copy this final version of GNU cpp into `/lib/cpp'.
  134.   5. Replace every occurrence of `obstack_free' in the file `tree.c'
  135.      with `_obstack_free'.
  136.   6. Run `make' to get the first-stage GNU CC.
  137.   7. Reinstall the original version of `/lib/cpp'.
  138.   8. Now you can compile GNU CC with itself and install it in the normal
  139.      fashion.
  140. File: gcc.info,  Node: Unos Install,  Next: VMS Install,  Prev: 3b1 Install,  Up: Installation
  141. Installing GNU CC on Unos
  142. =========================
  143.    Use `configure unos' for building on Unos.
  144.    The Unos assembler is named `casm' instead of `as'.  For some
  145. strange reason linking `/bin/as' to `/bin/casm' changes the behavior,
  146. and does not work.  So, when installing GNU CC, you should install the
  147. following script as `as' in the subdirectory where the passes of GCC
  148. are installed:
  149.      #!/bin/sh
  150.      casm $*
  151.    The default Unos library is named `libunos.a' instead of `libc.a'.
  152. To allow GNU CC to function, either change all references to `-lc' in
  153. `gcc.c' to `-lunos' or link `/lib/libc.a' to `/lib/libunos.a'.
  154.    When compiling GNU CC with the standard compiler, to overcome bugs in
  155. the support of `alloca', do not use `-O' when making stage 2.  Then use
  156. the stage 2 compiler with `-O' to make the stage 3 compiler.  This
  157. compiler will have the same characteristics as the usual stage 2
  158. compiler on other systems.  Use it to make a stage 4 compiler and
  159. compare that with stage 3 to verify proper compilation.
  160.    (Perhaps simply defining `ALLOCA' in `x-crds' as described in the
  161. comments there will make the above paragraph superfluous.  Please
  162. inform us of whether this works.)
  163.    Unos uses memory segmentation instead of demand paging, so you will
  164. need a lot of memory.  5 Mb is barely enough if no other tasks are
  165. running.  If linking `cc1' fails, try putting the object files into a
  166. library and linking from that library.
  167. File: gcc.info,  Node: VMS Install,  Next: WE32K Install,  Prev: Unos Install,  Up: Installation
  168. Installing GNU CC on VMS
  169. ========================
  170.    The VMS version of GNU CC is distributed in a backup saveset
  171. containing both source code and precompiled binaries.
  172.    To install the `gcc' command so you can use the compiler easily, in
  173. the same manner as you use the VMS C compiler, you must install the VMS
  174. CLD file for GNU CC as follows:
  175.   1. Define the VMS logical names `GNU_CC' and `GNU_CC_INCLUDE' to
  176.      point to the directories where the GNU CC executables
  177.      (`gcc-cpp.exe', `gcc-cc1.exe', etc.) and the C include files are
  178.      kept respectively.  This should be done with the commands:
  179.           $ assign /system /translation=concealed -
  180.             disk:[gcc.] gnu_cc
  181.           $ assign /system /translation=concealed -
  182.             disk:[gcc.include.] gnu_cc_include
  183.      with the appropriate disk and directory names.  These commands can
  184.      be placed in your system startup file so they will be executed
  185.      whenever the machine is rebooted.  You may, if you choose, do this
  186.      via the `GCC_INSTALL.COM' script in the `[GCC]' directory.
  187.   2. Install the `GCC' command with the command line:
  188.           $ set command /table=sys$common:[syslib]dcltables -
  189.             /output=sys$common:[syslib]dcltables gnu_cc:[000000]gcc
  190.           $ install replace sys$common:[syslib]dcltables
  191.   3. To install the help file, do the following:
  192.           $ library/help sys$library:helplib.hlb gcc.hlp
  193.      Now you can invoke the compiler with a command like `gcc /verbose
  194.      file.c', which is equivalent to the command `gcc -v -c file.c' in
  195.      Unix.
  196.    If you wish to use GNU C++ you must first install GNU CC, and then
  197. perform the following steps:
  198.   1. Define the VMS logical name `GNU_GXX_INCLUDE' to point to the
  199.      directory where the preprocessor will search for the C++ header
  200.      files.  This can be done with the command:
  201.           $ assign /system /translation=concealed -
  202.             disk:[gcc.gxx_include.] gnu_gxx_include
  203.      with the appropriate disk and directory name.  If you are going to
  204.      be using libg++, this is where the libg++ install procedure will
  205.      install the libg++ header files.
  206.   2. Obtain the file `gcc-cc1plus.exe', and place this in the same
  207.      directory that `gcc-cc1.exe' is kept.
  208.      The GNU C++ compiler can be invoked with a command like `gcc /plus
  209.      /verbose file.cc', which is equivalent to the command `g++ -v -c
  210.      file.cc' in Unix.
  211.    We try to put corresponding binaries and sources on the VMS
  212. distribution tape.  But sometimes the binaries will be from an older
  213. version than the sources, because we don't always have time to update
  214. them.  (Use the `/version' option to determine the version number of
  215. the binaries and compare it with the source file `version.c' to tell
  216. whether this is so.)  In this case, you should use the binaries you get
  217. to recompile the sources.  If you must recompile, here is how:
  218.   1. Execute the command procedure `vmsconfig.com' to set up the files
  219.      `tm.h', `config.h', `aux-output.c', and `md.', and to create files
  220.      `tconfig.h' and `hconfig.h'.  This procedure also creates several
  221.      linker option files used by `make-cc1.com' and a data file used by
  222.      `make-l2.com'.
  223.           $ @vmsconfig.com
  224.   2. Setup the logical names and command tables as defined above.  In
  225.      addition, define the VMS logical name `GNU_BISON' to point at the
  226.      to the directories where the Bison executable is kept.  This
  227.      should be done with the command:
  228.           $ assign /system /translation=concealed -
  229.             disk:[bison.] gnu_bison
  230.      You may, if you choose, use the `INSTALL_BISON.COM' script in the
  231.      `[BISON]' directory.
  232.   3. Install the `BISON' command with the command line:
  233.           $ set command /table=sys$common:[syslib]dcltables -
  234.             /output=sys$common:[syslib]dcltables -
  235.             gnu_bison:[000000]bison
  236.           $ install replace sys$common:[syslib]dcltables
  237.   4. Type `@make-gcc' to recompile everything (alternatively, submit
  238.      the file `make-gcc.com' to a batch queue).  If you wish to build
  239.      the GNU C++ compiler as well as the GNU CC compiler, you must
  240.      first edit `make-gcc.com' and follow the instructions that appear
  241.      in the comments.
  242.   5. In order to use GCC, you need a library of functions which GCC
  243.      compiled code will call to perform certain tasks, and these
  244.      functions are defined in the file `libgcc2.c'.  To compile this
  245.      you should use the command procedure `make-l2.com', which will
  246.      generate the library `libgcc2.olb'.  `libgcc2.olb' should be built
  247.      using the compiler built from the same distribution that
  248.      `libgcc2.c' came from, and `make-gcc.com' will automatically do
  249.      all of this for you.
  250.      To install the library, use the following commands:
  251.           $ library gnu_cc:[000000]gcclib/delete=(new,eprintf)
  252.           $ library gnu_cc:[000000]gcclib/delete=L_*
  253.           $ library libgcc2/extract=*/output=libgcc2.obj
  254.           $ library gnu_cc:[000000]gcclib libgcc2.obj
  255.      The first command simply removes old modules that will be replaced
  256.      with modules from `libgcc2' under different module names.  The
  257.      modules `new' and `eprintf' may not actually be present in your
  258.      `gcclib.olb'--if the VMS librarian complains about those modules
  259.      not being present, simply ignore the message and continue on with
  260.      the next command.  The second command removes the modules that
  261.      came from the previous version of the library `libgcc2.c'.
  262.      Whenever you update the compiler on your system, you should also
  263.      update the library with the above procedure.
  264.   6. You may wish to build GCC in such a way that no files are written
  265.      to the directory where the source files reside.  An example would
  266.      be the when the source files are on a read-only disk.  In these
  267.      cases, execute the following DCL commands (substituting your
  268.      actual path names):
  269.           $ assign dua0:[gcc.build_dir.]/translation=concealed, -
  270.                    dua1:[gcc.source_dir.]/translation=concealed  gcc_build
  271.           $ set default gcc_build:[000000]
  272.      where the directory `dua1:[gcc.source_dir]' contains the source
  273.      code, and the directory `dua0:[gcc.build_dir]' is meant to contain
  274.      all of the generated object files and executables.  Once you have
  275.      done this, you can proceed building GCC as described above.  (Keep
  276.      in mind that `gcc_build' is a rooted logical name, and thus the
  277.      device names in each element of the search list must be an actual
  278.      physical device name rather than another rooted logical name).
  279.   7. *If you are building GNU CC with a previous version of GNU CC, you
  280.      also should check to see that you have the newest version of the
  281.      assembler*.  In particular, GNU CC version 2 treats global constant
  282.      variables slightly differently from GNU CC version 1, and GAS
  283.      version 1.38.1 does not have the patches required to work with GCC
  284.      version 2.  If you use GAS 1.38.1, then `extern const' variables
  285.      will not have the read-only bit set, and the linker will generate
  286.      warning messages about mismatched psect attributes for these
  287.      variables.  These warning messages are merely a nuisance, and can
  288.      safely be ignored.
  289.      If you are compiling with a version of GNU CC older than 1.33,
  290.      specify `/DEFINE=("inline=")' as an option in all the
  291.      compilations.  This requires editing all the `gcc' commands in
  292.      `make-cc1.com'.  (The older versions had problems supporting
  293.      `inline'.)  Once you have a working 1.33 or newer GNU CC, you can
  294.      change this file back.
  295.   8. If you want to build GNU CC with the VAX C compiler, you will need
  296.      to make minor changes in `make-cccp.com' and `make-cc1.com' to
  297.      choose alternate definitions of `CC', `CFLAGS', and `LIBS'.  See
  298.      comments in those files.  However, you must also have a working
  299.      version of the GNU assembler (GNU as, aka GAS) as it is used as
  300.      the back-end for GNU CC to produce binary object modules and is
  301.      not included in the GNU CC sources.  GAS is also needed to compile
  302.      `libgcc2' in order to build `gcclib' (see above); `make-l2.com'
  303.      expects to be able to find it operational in
  304.      `gnu_cc:[000000]gnu-as.exe'.
  305.      To use GNU CC on VMS, you need the VMS driver programs `gcc.exe',
  306.      `gcc.com', and `gcc.cld'.  They are distributed with the VMS
  307.      binaries (`gcc-vms') rather than the GNU CC sources.  GAS is also
  308.      included in `gcc-vms', as is Bison.
  309.      Once you have successfully built GNU CC with VAX C, you should use
  310.      the resulting compiler to rebuild itself.  Before doing this, be
  311.      sure to restore the `CC', `CFLAGS', and `LIBS' definitions in
  312.      `make-cccp.com' and `make-cc1.com'.  The second generation
  313.      compiler will be able to take advantage of many optimizations that
  314.      must be suppressed when building with other compilers.
  315.    Under previous versions of GNU CC, the generated code would
  316. occasionally give strange results when linked with the sharable
  317. `VAXCRTL' library.  Now this should work.
  318.    Even with this version, however, GNU CC itself should not be linked
  319. with the sharable `VAXCRTL'.  The version of `qsort' in `VAXCRTL' has a
  320. bug (known to be present in VMS versions V4.6 through V5.5) which
  321. causes the compiler to fail.
  322.    The executables are generated by `make-cc1.com' and `make-cccp.com'
  323. use the object library version of `VAXCRTL' in order to make use of the
  324. `qsort' routine in `gcclib.olb'.  If you wish to link the compiler
  325. executables with the shareable image version of `VAXCRTL', you should
  326. edit the file `tm.h' (created by `vmsconfig.com') to define the macro
  327. `QSORT_WORKAROUND'.
  328.    `QSORT_WORKAROUND' is always defined when GNU CC is compiled with
  329. VAX C, to avoid a problem in case `gcclib.olb' is not yet available.
  330. File: gcc.info,  Node: WE32K Install,  Next: MIPS Install,  Prev: VMS Install,  Up: Installation
  331. Installing GNU CC on the WE32K
  332. ==============================
  333.    These computers are also known as the 3b2, 3b5, 3b20 and other
  334. similar names.  (However, the 3b1 is actually a 68000; see *Note 3b1
  335. Install::.)
  336.    Don't use `-g' when compiling with the system's compiler.  The
  337. system's linker seems to be unable to handle such a large program with
  338. debugging information.
  339.    The system's compiler runs out of capacity when compiling `stmt.c'
  340. in GNU CC.  You can work around this by building `cpp' in GNU CC first,
  341. then use that instead of the system's preprocessor with the system's C
  342. compiler to compile `stmt.c'.  Here is how:
  343.      mv /lib/cpp /lib/cpp.att
  344.      cp cpp /lib/cpp.gnu
  345.      echo '/lib/cpp.gnu -traditional ${1+"$@"}' > /lib/cpp
  346.      chmod +x /lib/cpp
  347.    The system's compiler produces bad code for some of the GNU CC
  348. optimization files.  So you must build the stage 2 compiler without
  349. optimization.  Then build a stage 3 compiler with optimization.  That
  350. executable should work.  Here are the necessary commands:
  351.      make LANGUAGES=c CC=stage1/xgcc CFLAGS="-Bstage1/ -g"
  352.      make stage2
  353.      make CC=stage2/xgcc CFLAGS="-Bstage2/ -g -O"
  354.    You may need to raise the ULIMIT setting to build a C++ compiler, as
  355. the file `cc1plus' is larger than one megabyte.
  356. File: gcc.info,  Node: MIPS Install,  Next: Collect2,  Prev: WE32K Install,  Up: Installation
  357. Installing GNU CC on the MIPS
  358. =============================
  359.    See *Note Installation:: about whether to use either of the options
  360. `--with-stabs' or `--with-gnu-as'.
  361.    The MIPS C compiler needs to be told to increase its table size for
  362. switch statements with the `-Wf,-XNg1500' option in order to compile
  363. `cp-parse.c'.  If you use the `-O2' optimization option, you also need
  364. to use `-Olimit 3000'.  Both of these options are automatically
  365. generated in the `Makefile' that the shell script `configure' builds.
  366. If you override the `CC' make variable and use the MIPS compilers, you
  367. may need to add `-Wf,-XNg1500 -Olimit 3000'.
  368.    MIPS computers running RISC-OS can support four different
  369. personalities: default, BSD 4.3, System V.3, and System V.4 (older
  370. versions of RISC-OS don't support V.4).  To configure GCC for these
  371. platforms use the following configurations:
  372. `mips-mips-riscos`rev''
  373.      Default configuration for RISC-OS, revision `rev'.
  374. `mips-mips-riscos`rev'bsd'
  375.      BSD 4.3 configuration for RISC-OS, revision `rev'.
  376. `mips-mips-riscos`rev'sysv4'
  377.      System V.4 configuration for RISC-OS, revision `rev'.
  378. `mips-mips-riscos`rev'sysv'
  379.      System V.3 configuration for RISC-OS, revision `rev'.
  380.    The revision `rev' mentioned above is the revision of RISC-OS to
  381. use.  You must reconfigure GCC when going from a RISC-OS revision 4 to
  382. RISC-OS revision 5.  This has the effect of avoiding a linker bug (see
  383. *Note Installation Problems:: for more details).
  384.    DECstations can support three different personalities: Ultrix, DEC
  385. OSF/1, and OSF/rose.  To configure GCC for these platforms use the
  386. following configurations:
  387. `decstation-ultrix'
  388.      Ultrix configuration.
  389. `decstation-osf1'
  390.      Dec's version of OSF/1.
  391. `decstation-osfrose'
  392.      Open Software Foundation reference port of OSF/1 which uses the
  393.      OSF/rose object file format instead of ECOFF.  Normally, you would
  394.      not select this configuration.
  395.    On Irix version 4.0.5F, and perhaps on some other versions as well,
  396. there is an assembler bug that reorders instructions incorrectly.  To
  397. work around it, specify the target configuration `mips-sgi-irix4loser'.
  398. This configuration inhibits assembler optimization.
  399.    You can turn off assembler optimization in a compiler configured with
  400. target `mips-sgi-irix4' using the `-noasmopt' option.  This compiler
  401. option passes the option `-O0' to the assembler, to inhibit reordering.
  402.    The `-noasmopt' option can be useful for testing whether a problem
  403. is due to erroneous assembler reordering.  Even if a problem does not go
  404. away with `-noasmopt', it may still be due to assembler
  405. reordering--perhaps GNU CC itself was miscompiled as a result.
  406.    We know this is inconvenient, but it's the best that can be done at
  407. the last minute.
  408. File: gcc.info,  Node: Collect2,  Next: Header Dirs,  Prev: MIPS Install,  Up: Installation
  409. `collect2'
  410. ==========
  411.    Many target systems do not have support in the assembler and linker
  412. for "constructors"--initialization functions to be called before the
  413. official "start" of `main'.  On such systems, GNU CC uses a utility
  414. called `collect2' to arrange to call these functions at start time.
  415.    The program `collect2' works by linking the program once and looking
  416. through the linker output file for symbols with particular names
  417. indicating they are constructor functions.  If it finds any, it creates
  418. a new temporary `.c' file containing a table of them, compiles it, and
  419. links the program a second time including that file.
  420.    The actual calls to the constructors are carried out by a subroutine
  421. called `__main', which is called (automatically) at the beginning of
  422. the body of `main' (provided `main' was compiled with GNU CC).
  423.    The program `collect2' is installed as `ld' in the directory where
  424. the passes of the compiler are installed.  When `collect2' needs to
  425. find the *real* `ld', it tries the following file names:
  426.    * `gld' in the directories listed in the compiler's search
  427.      directories.
  428.    * `gld' in the directories listed in the environment variable `PATH'.
  429.    * `real-ld' in the compiler's search directories.
  430.    * `real-ld' in `PATH'.
  431.    * `ld' in `PATH'.
  432.    "The compiler's search directories" means all the directories where
  433. `gcc' searches for passes of the compiler.  This includes directories
  434. that you specify with `-B'.
  435.    Cross-compilers search a little differently:
  436.    * `gld' in the compiler's search directories.
  437.    * `TARGET-gld' in `PATH'.
  438.    * `real-ld' in the compiler's search directories.
  439.    * `TARGET-real-ld' in `PATH'.
  440.    * `TARGET-ld' in `PATH'.
  441.    `collect2' does not search for `ld' using the compiler's search
  442. directories, because if it did, it would find itself--not the real
  443. `ld'--and this could lead to infinite recursion.  However, the
  444. directory where `collect2' is installed might happen to be in `PATH'.
  445. That could lead `collect2' to invoke itself anyway.  when looking for
  446. `ld'.
  447.    To prevent this, `collect2' explicitly avoids running `ld' using the
  448. file name under which `collect2' itself was invoked.  In fact, it
  449. remembers up to two such names--in case one copy of `collect2' finds
  450. another copy (or version) of `collect2' installed as `ld' in a second
  451. place in the search path.
  452.    If two file names to avoid are not sufficient, you may still
  453. encounter an infinite recursion of `collect2' processes.  When this
  454. happens.  check all the files installed as `ld' in any of the
  455. directories searched, and straighten out the situation.
  456.    (In a future version, we will probably change `collect2' to avoid
  457. any reinvocation of a file from which any parent `collect2' was run.)
  458. File: gcc.info,  Node: Header Dirs,  Prev: Collect2,  Up: Installation
  459. Standard Header File Directories
  460. ================================
  461.    `GCC_INCLUDE_DIR' means the same thing for native and cross.  It is
  462. where GNU CC stores its private include files, and also where GNU CC
  463. stores the fixed include files.  A cross compiled GNU CC runs
  464. `fixincludes' on the header files in `$(tooldir)/include'.  (If the
  465. cross compilation header files need to be fixed, they must be installed
  466. before GNU CC is built.  If the cross compilation header files are
  467. already suitable for ANSI C and GNU CC, nothing special need be done).
  468.    `GPLUS_INCLUDE_DIR' means the same thing for native and cross.  It
  469. is where `g++' looks first for header files.  `libg++' installs only
  470. target independent header files in that directory.
  471.    `LOCAL_INCLUDE_DIR' is used only for a native compiler.  It is
  472. normally `/gnu/include'.  GNU CC searches this directory so that users
  473. can install header files in `/gnu/include'.
  474.    `CROSS_INCLUDE_DIR' is used only for a cross compiler.  GNU CC
  475. doesn't install anything there.
  476.    `TOOL_INCLUDE_DIR' is used for both native and cross compilers.  It
  477. is the place for other packages to install header files that GNU CC will
  478. use.  For a cross-compiler, this is the equivalent of `/usr/include'.
  479. When you build a cross-compiler, `fixincludes' processes any header
  480. files in this directory.
  481. File: gcc.info,  Node: C Extensions,  Next: C++ Extensions,  Prev: Installation,  Up: Top
  482. Extensions to the C Language Family
  483. ***********************************
  484.    GNU C provides several language features not found in ANSI standard
  485. C.  (The `-pedantic' option directs GNU CC to print a warning message if
  486. any of these features is used.)  To test for the availability of these
  487. features in conditional compilation, check for a predefined macro
  488. `__GNUC__', which is always defined under GNU CC.
  489.    These extensions are available in C and in the languages derived from
  490. it, C++ and Objective C.  *Note Extensions to the C++ Language: C++
  491. Extensions, for extensions that apply *only* to C++.
  492. * Menu:
  493. * Statement Exprs::     Putting statements and declarations inside expressions.
  494. * Local Labels::        Labels local to a statement-expression.
  495. * Labels as Values::    Getting pointers to labels, and computed gotos.
  496. * Nested Functions::    As in Algol and Pascal, lexical scoping of functions.
  497. * Constructing Calls::    Dispatching a call to another function.
  498. * Naming Types::        Giving a name to the type of some expression.
  499. * Typeof::              `typeof': referring to the type of an expression.
  500. * Lvalues::             Using `?:', `,' and casts in lvalues.
  501. * Conditionals::        Omitting the middle operand of a `?:' expression.
  502. * Long Long::        Double-word integers--`long long int'.
  503. * Complex::             Data types for complex numbers.
  504. * Zero Length::         Zero-length arrays.
  505. * Variable Length::     Arrays whose length is computed at run time.
  506. * Macro Varargs::    Macros with variable number of arguments.
  507. * Subscripting::        Any array can be subscripted, even if not an lvalue.
  508. * Pointer Arith::       Arithmetic on `void'-pointers and function pointers.
  509. * Initializers::        Non-constant initializers.
  510. * Constructors::        Constructor expressions give structures, unions
  511.                          or arrays as values.
  512. * Labeled Elements::    Labeling elements of initializers.
  513. * Cast to Union::       Casting to union type from any member of the union.
  514. * Case Ranges::        `case 1 ... 9' and such.
  515. * Function Attributes:: Declaring that functions have no side effects,
  516.                          or that they can never return.
  517. * Function Prototypes:: Prototype declarations and old-style definitions.
  518. * Dollar Signs::        Dollar sign is allowed in identifiers.
  519. * Character Escapes::   `\e' stands for the character ESC.
  520. * Variable Attributes::    Specifying attributes of variables.
  521. * Alignment::           Inquiring about the alignment of a type or variable.
  522. * Inline::              Defining inline functions (as fast as macros).
  523. * Extended Asm::        Assembler instructions with C expressions as operands.
  524.                          (With them you can define "built-in" functions.)
  525. * Asm Labels::          Specifying the assembler name to use for a C symbol.
  526. * Explicit Reg Vars::   Defining variables residing in specified registers.
  527. * Alternate Keywords::  `__const__', `__asm__', etc., for header files.
  528. * Incomplete Enums::    `enum foo;', with details to follow.
  529. * Function Names::    Printable strings which are the name of the current
  530.              function.
  531. File: gcc.info,  Node: Statement Exprs,  Next: Local Labels,  Up: C Extensions
  532. Statements and Declarations in Expressions
  533. ==========================================
  534.    A compound statement enclosed in parentheses may appear as an
  535. expression in GNU C.  This allows you to use loops, switches, and local
  536. variables within an expression.
  537.    Recall that a compound statement is a sequence of statements
  538. surrounded by braces; in this construct, parentheses go around the
  539. braces.  For example:
  540.      ({ int y = foo (); int z;
  541.         if (y > 0) z = y;
  542.         else z = - y;
  543.         z; })
  544. is a valid (though slightly more complex than necessary) expression for
  545. the absolute value of `foo ()'.
  546.    The last thing in the compound statement should be an expression
  547. followed by a semicolon; the value of this subexpression serves as the
  548. value of the entire construct.  (If you use some other kind of statement
  549. last within the braces, the construct has type `void', and thus
  550. effectively no value.)
  551.    This feature is especially useful in making macro definitions "safe"
  552. (so that they evaluate each operand exactly once).  For example, the
  553. "maximum" function is commonly defined as a macro in standard C as
  554. follows:
  555.      #define max(a,b) ((a) > (b) ? (a) : (b))
  556. But this definition computes either A or B twice, with bad results if
  557. the operand has side effects.  In GNU C, if you know the type of the
  558. operands (here let's assume `int'), you can define the macro safely as
  559. follows:
  560.      #define maxint(a,b) \
  561.        ({int _a = (a), _b = (b); _a > _b ? _a : _b; })
  562.    Embedded statements are not allowed in constant expressions, such as
  563. the value of an enumeration constant, the width of a bit field, or the
  564. initial value of a static variable.
  565.    If you don't know the type of the operand, you can still do this,
  566. but you must use `typeof' (*note Typeof::.) or type naming (*note
  567. Naming Types::.).
  568. File: gcc.info,  Node: Local Labels,  Next: Labels as Values,  Prev: Statement Exprs,  Up: C Extensions
  569. Locally Declared Labels
  570. =======================
  571.    Each statement expression is a scope in which "local labels" can be
  572. declared.  A local label is simply an identifier; you can jump to it
  573. with an ordinary `goto' statement, but only from within the statement
  574. expression it belongs to.
  575.    A local label declaration looks like this:
  576.      __label__ LABEL;
  577.      __label__ LABEL1, LABEL2, ...;
  578.    Local label declarations must come at the beginning of the statement
  579. expression, right after the `({', before any ordinary declarations.
  580.    The label declaration defines the label *name*, but does not define
  581. the label itself.  You must do this in the usual way, with `LABEL:',
  582. within the statements of the statement expression.
  583.    The local label feature is useful because statement expressions are
  584. often used in macros.  If the macro contains nested loops, a `goto' can
  585. be useful for breaking out of them.  However, an ordinary label whose
  586. scope is the whole function cannot be used: if the macro can be
  587. expanded several times in one function, the label will be multiply
  588. defined in that function.  A local label avoids this problem.  For
  589. example:
  590.      #define SEARCH(array, target)                     \
  591.      ({                                               \
  592.        __label__ found;                                \
  593.        typeof (target) _SEARCH_target = (target);      \
  594.        typeof (*(array)) *_SEARCH_array = (array);     \
  595.        int i, j;                                       \
  596.        int value;                                      \
  597.        for (i = 0; i < max; i++)                       \
  598.          for (j = 0; j < max; j++)                     \
  599.            if (_SEARCH_array[i][j] == _SEARCH_target)  \
  600.              { value = i; goto found; }              \
  601.        value = -1;                                     \
  602.       found:                                           \
  603.        value;                                          \
  604.      })
  605. File: gcc.info,  Node: Labels as Values,  Next: Nested Functions,  Prev: Local Labels,  Up: C Extensions
  606. Labels as Values
  607. ================
  608.    You can get the address of a label defined in the current function
  609. (or a containing function) with the unary operator `&&'.  The value has
  610. type `void *'.  This value is a constant and can be used wherever a
  611. constant of that type is valid.  For example:
  612.      void *ptr;
  613.      ...
  614.      ptr = &&foo;
  615.    To use these values, you need to be able to jump to one.  This is
  616. done with the computed goto statement(1), `goto *EXP;'.  For example,
  617.      goto *ptr;
  618. Any expression of type `void *' is allowed.
  619.    One way of using these constants is in initializing a static array
  620. that will serve as a jump table:
  621.      static void *array[] = { &&foo, &&bar, &&hack };
  622.    Then you can select a label with indexing, like this:
  623.      goto *array[i];
  624. Note that this does not check whether the subscript is in bounds--array
  625. indexing in C never does that.
  626.    Such an array of label values serves a purpose much like that of the
  627. `switch' statement.  The `switch' statement is cleaner, so use that
  628. rather than an array unless the problem does not fit a `switch'
  629. statement very well.
  630.    Another use of label values is in an interpreter for threaded code.
  631. The labels within the interpreter function can be stored in the
  632. threaded code for super-fast dispatching.
  633.    You can use this mechanism to jump to code in a different function.
  634. If you do that, totally unpredictable things will happen.  The best way
  635. to avoid this is to store the label address only in automatic variables
  636. and never pass it as an argument.
  637.    ---------- Footnotes ----------
  638.    (1)  The analogous feature in Fortran is called an assigned goto,
  639. but that name seems inappropriate in C, where one can do more than
  640. simply store label addresses in label variables.
  641. File: gcc.info,  Node: Nested Functions,  Next: Constructing Calls,  Prev: Labels as Values,  Up: C Extensions
  642. Nested Functions
  643. ================
  644.    A "nested function" is a function defined inside another function.
  645. (Nested functions are not supported for GNU C++.)  The nested function's
  646. name is local to the block where it is defined.  For example, here we
  647. define a nested function named `square', and call it twice:
  648.      foo (double a, double b)
  649.      {
  650.        double square (double z) { return z * z; }
  651.      
  652.        return square (a) + square (b);
  653.      }
  654.    The nested function can access all the variables of the containing
  655. function that are visible at the point of its definition.  This is
  656. called "lexical scoping".  For example, here we show a nested function
  657. which uses an inherited variable named `offset':
  658.      bar (int *array, int offset, int size)
  659.      {
  660.        int access (int *array, int index)
  661.          { return array[index + offset]; }
  662.        int i;
  663.        ...
  664.        for (i = 0; i < size; i++)
  665.          ... access (array, i) ...
  666.      }
  667.    Nested function definitions are permitted within functions in the
  668. places where variable definitions are allowed; that is, in any block,
  669. before the first statement in the block.
  670.    It is possible to call the nested function from outside the scope of
  671. its name by storing its address or passing the address to another
  672. function:
  673.      hack (int *array, int size)
  674.      {
  675.        void store (int index, int value)
  676.          { array[index] = value; }
  677.      
  678.        intermediate (store, size);
  679.      }
  680.    Here, the function `intermediate' receives the address of `store' as
  681. an argument.  If `intermediate' calls `store', the arguments given to
  682. `store' are used to store into `array'.  But this technique works only
  683. so long as the containing function (`hack', in this example) does not
  684. exit.
  685.    If you try to call the nested function through its address after the
  686. containing function has exited, all hell will break loose.  If you try
  687. to call it after a containing scope level has exited, and if it refers
  688. to some of the variables that are no longer in scope, you may be lucky,
  689. but it's not wise to take the risk.  If, however, the nested function
  690. does not refer to anything that has gone out of scope, you should be
  691. safe.
  692.    GNU CC implements taking the address of a nested function using a
  693. technique called "trampolines".  A paper describing them is available
  694. from `maya.idiap.ch' in directory `pub/tmb', file `usenix88-lexic.ps.Z'.
  695.    A nested function can jump to a label inherited from a containing
  696. function, provided the label was explicitly declared in the containing
  697. function (*note Local Labels::.).  Such a jump returns instantly to the
  698. containing function, exiting the nested function which did the `goto'
  699. and any intermediate functions as well.  Here is an example:
  700.      bar (int *array, int offset, int size)
  701.      {
  702.        __label__ failure;
  703.        int access (int *array, int index)
  704.          {
  705.            if (index > size)
  706.              goto failure;
  707.            return array[index + offset];
  708.          }
  709.        int i;
  710.        ...
  711.        for (i = 0; i < size; i++)
  712.          ... access (array, i) ...
  713.        ...
  714.        return 0;
  715.      
  716.       /* Control comes here from `access'
  717.          if it detects an error.  */
  718.       failure:
  719.        return -1;
  720.      }
  721.    A nested function always has internal linkage.  Declaring one with
  722. `extern' is erroneous.  If you need to declare the nested function
  723. before its definition, use `auto' (which is otherwise meaningless for
  724. function declarations).
  725.      bar (int *array, int offset, int size)
  726.      {
  727.        __label__ failure;
  728.        auto int access (int *, int);
  729.        ...
  730.        int access (int *array, int index)
  731.          {
  732.            if (index > size)
  733.              goto failure;
  734.            return array[index + offset];
  735.          }
  736.        ...
  737.      }
  738. File: gcc.info,  Node: Constructing Calls,  Next: Naming Types,  Prev: Nested Functions,  Up: C Extensions
  739. Constructing Function Calls
  740. ===========================
  741.    Using the built-in functions described below, you can record the
  742. arguments a function received, and call another function with the same
  743. arguments, without knowing the number or types of the arguments.
  744.    You can also record the return value of that function call, and
  745. later return that value, without knowing what data type the function
  746. tried to return (as long as your caller expects that data type).
  747. `__builtin_apply_args ()'
  748.      This built-in function returns a pointer of type `void *' to data
  749.      describing how to perform a call with the same arguments as were
  750.      passed to the current function.
  751.      The function saves the arg pointer register, structure value
  752.      address, and all registers that might be used to pass arguments to
  753.      a function into a block of memory allocated on the stack.  Then it
  754.      returns the address of that block.
  755. `__builtin_apply (FUNCTION, ARGUMENTS, SIZE)'
  756.      This built-in function invokes FUNCTION (type `void (*)()') with a
  757.      copy of the parameters described by ARGUMENTS (type `void *') and
  758.      SIZE (type `int').
  759.      The value of ARGUMENTS should be the value returned by
  760.      `__builtin_apply_args'.  The argument SIZE specifies the size of
  761.      the stack argument data, in bytes.
  762.      This function returns a pointer of type `void *' to data describing
  763.      how to return whatever value was returned by FUNCTION.  The data
  764.      is saved in a block of memory allocated on the stack.
  765.      It is not always simple to compute the proper value for SIZE.  The
  766.      value is used by `__builtin_apply' to compute the amount of data
  767.      that should be pushed on the stack and copied from the incoming
  768.      argument area.
  769. `__builtin_return (RESULT)'
  770.      This built-in function returns the value described by RESULT from
  771.      the containing function.  You should specify, for RESULT, a value
  772.      returned by `__builtin_apply'.
  773. File: gcc.info,  Node: Naming Types,  Next: Typeof,  Prev: Constructing Calls,  Up: C Extensions
  774. Naming an Expression's Type
  775. ===========================
  776.    You can give a name to the type of an expression using a `typedef'
  777. declaration with an initializer.  Here is how to define NAME as a type
  778. name for the type of EXP:
  779.      typedef NAME = EXP;
  780.    This is useful in conjunction with the statements-within-expressions
  781. feature.  Here is how the two together can be used to define a safe
  782. "maximum" macro that operates on any arithmetic type:
  783.      #define max(a,b) \
  784.        ({typedef _ta = (a), _tb = (b);  \
  785.          _ta _a = (a); _tb _b = (b);     \
  786.          _a > _b ? _a : _b; })
  787.    The reason for using names that start with underscores for the local
  788. variables is to avoid conflicts with variable names that occur within
  789. the expressions that are substituted for `a' and `b'.  Eventually we
  790. hope to design a new form of declaration syntax that allows you to
  791. declare variables whose scopes start only after their initializers;
  792. this will be a more reliable way to prevent such conflicts.
  793. File: gcc.info,  Node: Typeof,  Next: Lvalues,  Prev: Naming Types,  Up: C Extensions
  794. Referring to a Type with `typeof'
  795. =================================
  796.    Another way to refer to the type of an expression is with `typeof'.
  797. The syntax of using of this keyword looks like `sizeof', but the
  798. construct acts semantically like a type name defined with `typedef'.
  799.    There are two ways of writing the argument to `typeof': with an
  800. expression or with a type.  Here is an example with an expression:
  801.      typeof (x[0](1))
  802. This assumes that `x' is an array of functions; the type described is
  803. that of the values of the functions.
  804.    Here is an example with a typename as the argument:
  805.      typeof (int *)
  806. Here the type described is that of pointers to `int'.
  807.    If you are writing a header file that must work when included in
  808. ANSI C programs, write `__typeof__' instead of `typeof'.  *Note
  809. Alternate Keywords::.
  810.    A `typeof'-construct can be used anywhere a typedef name could be
  811. used.  For example, you can use it in a declaration, in a cast, or
  812. inside of `sizeof' or `typeof'.
  813.    * This declares `y' with the type of what `x' points to.
  814.           typeof (*x) y;
  815.    * This declares `y' as an array of such values.
  816.           typeof (*x) y[4];
  817.    * This declares `y' as an array of pointers to characters:
  818.           typeof (typeof (char *)[4]) y;
  819.      It is equivalent to the following traditional C declaration:
  820.           char *y[4];
  821.      To see the meaning of the declaration using `typeof', and why it
  822.      might be a useful way to write, let's rewrite it with these macros:
  823.           #define pointer(T)  typeof(T *)
  824.           #define array(T, N) typeof(T [N])
  825.      Now the declaration can be rewritten this way:
  826.           array (pointer (char), 4) y;
  827.      Thus, `array (pointer (char), 4)' is the type of arrays of 4
  828.      pointers to `char'.
  829. File: gcc.info,  Node: Lvalues,  Next: Conditionals,  Prev: Typeof,  Up: C Extensions
  830. Generalized Lvalues
  831. ===================
  832.    Compound expressions, conditional expressions and casts are allowed
  833. as lvalues provided their operands are lvalues.  This means that you
  834. can take their addresses or store values into them.
  835.    For example, a compound expression can be assigned, provided the last
  836. expression in the sequence is an lvalue.  These two expressions are
  837. equivalent:
  838.      (a, b) += 5
  839.      a, (b += 5)
  840.    Similarly, the address of the compound expression can be taken.
  841. These two expressions are equivalent:
  842.      &(a, b)
  843.      a, &b
  844.    A conditional expression is a valid lvalue if its type is not void
  845. and the true and false branches are both valid lvalues.  For example,
  846. these two expressions are equivalent:
  847.      (a ? b : c) = 5
  848.      (a ? b = 5 : (c = 5))
  849.    A cast is a valid lvalue if its operand is an lvalue.  A simple
  850. assignment whose left-hand side is a cast works by converting the
  851. right-hand side first to the specified type, then to the type of the
  852. inner left-hand side expression.  After this is stored, the value is
  853. converted back to the specified type to become the value of the
  854. assignment.  Thus, if `a' has type `char *', the following two
  855. expressions are equivalent:
  856.      (int)a = 5
  857.      (int)(a = (char *)(int)5)
  858.    An assignment-with-arithmetic operation such as `+=' applied to a
  859. cast performs the arithmetic using the type resulting from the cast,
  860. and then continues as in the previous case.  Therefore, these two
  861. expressions are equivalent:
  862.      (int)a += 5
  863.      (int)(a = (char *)(int) ((int)a + 5))
  864.    You cannot take the address of an lvalue cast, because the use of its
  865. address would not work out coherently.  Suppose that `&(int)f' were
  866. permitted, where `f' has type `float'.  Then the following statement
  867. would try to store an integer bit-pattern where a floating point number
  868. belongs:
  869.      *&(int)f = 1;
  870.    This is quite different from what `(int)f = 1' would do--that would
  871. convert 1 to floating point and store it.  Rather than cause this
  872. inconsistency, we think it is better to prohibit use of `&' on a cast.
  873.    If you really do want an `int *' pointer with the address of `f',
  874. you can simply write `(int *)&f'.
  875. File: gcc.info,  Node: Conditionals,  Next: Long Long,  Prev: Lvalues,  Up: C Extensions
  876. Conditionals with Omitted Operands
  877. ==================================
  878.    The middle operand in a conditional expression may be omitted.  Then
  879. if the first operand is nonzero, its value is the value of the
  880. conditional expression.
  881.    Therefore, the expression
  882.      x ? : y
  883. has the value of `x' if that is nonzero; otherwise, the value of `y'.
  884.    This example is perfectly equivalent to
  885.      x ? x : y
  886. In this simple case, the ability to omit the middle operand is not
  887. especially useful.  When it becomes useful is when the first operand
  888. does, or may (if it is a macro argument), contain a side effect.  Then
  889. repeating the operand in the middle would perform the side effect
  890. twice.  Omitting the middle operand uses the value already computed
  891. without the undesirable effects of recomputing it.
  892. File: gcc.info,  Node: Long Long,  Next: Complex,  Prev: Conditionals,  Up: C Extensions
  893. Double-Word Integers
  894. ====================
  895.    GNU C supports data types for integers that are twice as long as
  896. `long int'.  Simply write `long long int' for a signed integer, or
  897. `unsigned long long int' for an unsigned integer.  To make an integer
  898. constant of type `long long int', add the suffix `LL' to the integer.
  899. To make an integer constant of type `unsigned long long int', add the
  900. suffix `ULL' to the integer.
  901.    You can use these types in arithmetic like any other integer types.
  902. Addition, subtraction, and bitwise boolean operations on these types
  903. are open-coded on all types of machines.  Multiplication is open-coded
  904. if the machine supports fullword-to-doubleword a widening multiply
  905. instruction.  Division and shifts are open-coded only on machines that
  906. provide special support.  The operations that are not open-coded use
  907. special library routines that come with GNU CC.
  908.    There may be pitfalls when you use `long long' types for function
  909. arguments, unless you declare function prototypes.  If a function
  910. expects type `int' for its argument, and you pass a value of type `long
  911. long int', confusion will result because the caller and the subroutine
  912. will disagree about the number of bytes for the argument.  Likewise, if
  913. the function expects `long long int' and you pass `int'.  The best way
  914. to avoid such problems is to use prototypes.
  915.