home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / gpc_2 / !gcc / docs / pascal / gpc < prev   
Encoding:
GNU Info File  |  1996-11-11  |  339.8 KB  |  8,855 lines

  1. This is Info file ^.!gcc.docs.pascal.gpc, produced by Makeinfo-1.63
  2. from the input file texi.gpc.
  3.  
  4.    This file documents the use of the GNU Pascal compiler.
  5.  
  6.    Copyright (C) 1988, 1996 Free Software Foundation, Inc.
  7.  
  8.    Permission is granted to make and distribute verbatim copies of this
  9. manual provided the copyright notice and this permission notice are
  10. preserved on all copies.
  11.  
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided also
  14. that the sections entitled "GNU General Public License," "Funding for
  15. Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
  16. included exactly as in the original, and provided that the entire
  17. resulting derived work is distributed under the terms of a permission
  18. notice identical to this one.
  19.  
  20.    Permission is granted to copy and distribute translations of this
  21. manual into another language, under the above conditions for modified
  22. versions, except that the sections entitled "GNU General Public
  23. License," "Funding for Free Software," and "Protect Your Freedom--Fight
  24. `Look And Feel'", and this permission notice, may be included in
  25. translations approved by the Free Software Foundation instead of in the
  26. original English.
  27.  
  28. 
  29. File: ^.!gcc.docs.pascal.gpc,  Node: Top,  Next: Copying,  Up: (DIR)
  30.  
  31. GNU Pascal
  32. **********
  33.  
  34.    This manual documents how to run and install the GNU Pascal compiler
  35. (GPC), as well as its new features and incompatibilities, and how to
  36. report bugs.  It corresponds to GPC version 1.2 (2.7.2).
  37.  
  38. * Menu:
  39.  
  40. * Copying::           GNU General Public License says
  41.                       how you can copy and share GPC.
  42. * Contributors::      People who have contributed to GPC.
  43. * Funding::           How to help assure funding for free software.
  44. * Look and Feel::     Protect your freedom--fight "look and feel".
  45. * Manifesto::         What's GNU?  GNU's Not Unix!
  46.  
  47. * Purpose::           The Purpose of GNU Pascal.
  48. * Installation::      How to configure, compile and install GNU Pascal.
  49. * Invoking GPC::      Command options supported by `gpc'.
  50.  
  51. * Keywords::          Pascal Keywords and operators supported by GNU Pascal.
  52. * Built-in::          Other built-in Identifiers.
  53. * Extensions::        Extensions to Standard Pascal supported by GPC.
  54. * Extended Pascal::   About Pascal and Extended Pascal languages.
  55. * Borland Pascal::    A QuickStart guide from Borland Pascal to GNU Pascal.
  56.  
  57. * FPK Pascal::        A comparision between the FreeWare compilers
  58.                       FPK Pascal and GNU Pascal.
  59.  
  60. * GPC Bugs::          Known bugs and inconveniences; how to report bugs.
  61. * How to Contribute:: How *you* can contribute to the GNU Pascal project.
  62.  
  63. * Index::          Index of concepts and symbol names (incomplete).
  64.  
  65. 
  66. File: ^.!gcc.docs.pascal.gpc,  Node: Copying,  Next: Contributors,  Prev: Top,  Up: Top
  67.  
  68. GNU GENERAL PUBLIC LICENSE
  69. **************************
  70.  
  71.                          Version 2, June 1991
  72.  
  73.      Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  74.      59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  75.      
  76.      Everyone is permitted to copy and distribute verbatim copies
  77.      of this license document, but changing it is not allowed.
  78.  
  79. Preamble
  80. ========
  81.  
  82.    The licenses for most software are designed to take away your
  83. freedom to share and change it.  By contrast, the GNU General Public
  84. License is intended to guarantee your freedom to share and change free
  85. software--to make sure the software is free for all its users.  This
  86. General Public License applies to most of the Free Software
  87. Foundation's software and to any other program whose authors commit to
  88. using it.  (Some other Free Software Foundation software is covered by
  89. the GNU Library General Public License instead.)  You can apply it to
  90. your programs, too.
  91.  
  92.    When we speak of free software, we are referring to freedom, not
  93. price.  Our General Public Licenses are designed to make sure that you
  94. have the freedom to distribute copies of free software (and charge for
  95. this service if you wish), that you receive source code or can get it
  96. if you want it, that you can change the software or use pieces of it in
  97. new free programs; and that you know you can do these things.
  98.  
  99.    To protect your rights, we need to make restrictions that forbid
  100. anyone to deny you these rights or to ask you to surrender the rights.
  101. These restrictions translate to certain responsibilities for you if you
  102. distribute copies of the software, or if you modify it.
  103.  
  104.    For example, if you distribute copies of such a program, whether
  105. gratis or for a fee, you must give the recipients all the rights that
  106. you have.  You must make sure that they, too, receive or can get the
  107. source code.  And you must show them these terms so they know their
  108. rights.
  109.  
  110.    We protect your rights with two steps: (1) copyright the software,
  111. and (2) offer you this license which gives you legal permission to copy,
  112. distribute and/or modify the software.
  113.  
  114.    Also, for each author's protection and ours, we want to make certain
  115. that everyone understands that there is no warranty for this free
  116. software.  If the software is modified by someone else and passed on, we
  117. want its recipients to know that what they have is not the original, so
  118. that any problems introduced by others will not reflect on the original
  119. authors' reputations.
  120.  
  121.    Finally, any free program is threatened constantly by software
  122. patents.  We wish to avoid the danger that redistributors of a free
  123. program will individually obtain patent licenses, in effect making the
  124. program proprietary.  To prevent this, we have made it clear that any
  125. patent must be licensed for everyone's free use or not licensed at all.
  126.  
  127.    The precise terms and conditions for copying, distribution and
  128. modification follow.
  129.  
  130.     TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  131.  
  132.   0. This License applies to any program or other work which contains a
  133.      notice placed by the copyright holder saying it may be distributed
  134.      under the terms of this General Public License.  The "Program",
  135.      below, refers to any such program or work, and a "work based on
  136.      the Program" means either the Program or any derivative work under
  137.      copyright law: that is to say, a work containing the Program or a
  138.      portion of it, either verbatim or with modifications and/or
  139.      translated into another language.  (Hereinafter, translation is
  140.      included without limitation in the term "modification".)  Each
  141.      licensee is addressed as "you".
  142.  
  143.      Activities other than copying, distribution and modification are
  144.      not covered by this License; they are outside its scope.  The act
  145.      of running the Program is not restricted, and the output from the
  146.      Program is covered only if its contents constitute a work based on
  147.      the Program (independent of having been made by running the
  148.      Program).  Whether that is true depends on what the Program does.
  149.  
  150.   1. You may copy and distribute verbatim copies of the Program's
  151.      source code as you receive it, in any medium, provided that you
  152.      conspicuously and appropriately publish on each copy an appropriate
  153.      copyright notice and disclaimer of warranty; keep intact all the
  154.      notices that refer to this License and to the absence of any
  155.      warranty; and give any other recipients of the Program a copy of
  156.      this License along with the Program.
  157.  
  158.      You may charge a fee for the physical act of transferring a copy,
  159.      and you may at your option offer warranty protection in exchange
  160.      for a fee.
  161.  
  162.   2. You may modify your copy or copies of the Program or any portion
  163.      of it, thus forming a work based on the Program, and copy and
  164.      distribute such modifications or work under the terms of Section 1
  165.      above, provided that you also meet all of these conditions:
  166.  
  167.        a. You must cause the modified files to carry prominent notices
  168.           stating that you changed the files and the date of any change.
  169.  
  170.        b. You must cause any work that you distribute or publish, that
  171.           in whole or in part contains or is derived from the Program
  172.           or any part thereof, to be licensed as a whole at no charge
  173.           to all third parties under the terms of this License.
  174.  
  175.        c. If the modified program normally reads commands interactively
  176.           when run, you must cause it, when started running for such
  177.           interactive use in the most ordinary way, to print or display
  178.           an announcement including an appropriate copyright notice and
  179.           a notice that there is no warranty (or else, saying that you
  180.           provide a warranty) and that users may redistribute the
  181.           program under these conditions, and telling the user how to
  182.           view a copy of this License.  (Exception: if the Program
  183.           itself is interactive but does not normally print such an
  184.           announcement, your work based on the Program is not required
  185.           to print an announcement.)
  186.  
  187.      These requirements apply to the modified work as a whole.  If
  188.      identifiable sections of that work are not derived from the
  189.      Program, and can be reasonably considered independent and separate
  190.      works in themselves, then this License, and its terms, do not
  191.      apply to those sections when you distribute them as separate
  192.      works.  But when you distribute the same sections as part of a
  193.      whole which is a work based on the Program, the distribution of
  194.      the whole must be on the terms of this License, whose permissions
  195.      for other licensees extend to the entire whole, and thus to each
  196.      and every part regardless of who wrote it.
  197.  
  198.      Thus, it is not the intent of this section to claim rights or
  199.      contest your rights to work written entirely by you; rather, the
  200.      intent is to exercise the right to control the distribution of
  201.      derivative or collective works based on the Program.
  202.  
  203.      In addition, mere aggregation of another work not based on the
  204.      Program with the Program (or with a work based on the Program) on
  205.      a volume of a storage or distribution medium does not bring the
  206.      other work under the scope of this License.
  207.  
  208.   3. You may copy and distribute the Program (or a work based on it,
  209.      under Section 2) in object code or executable form under the terms
  210.      of Sections 1 and 2 above provided that you also do one of the
  211.      following:
  212.  
  213.        a. Accompany it with the complete corresponding machine-readable
  214.           source code, which must be distributed under the terms of
  215.           Sections 1 and 2 above on a medium customarily used for
  216.           software interchange; or,
  217.  
  218.        b. Accompany it with a written offer, valid for at least three
  219.           years, to give any third party, for a charge no more than your
  220.           cost of physically performing source distribution, a complete
  221.           machine-readable copy of the corresponding source code, to be
  222.           distributed under the terms of Sections 1 and 2 above on a
  223.           medium customarily used for software interchange; or,
  224.  
  225.        c. Accompany it with the information you received as to the offer
  226.           to distribute corresponding source code.  (This alternative is
  227.           allowed only for noncommercial distribution and only if you
  228.           received the program in object code or executable form with
  229.           such an offer, in accord with Subsection b above.)
  230.  
  231.      The source code for a work means the preferred form of the work for
  232.      making modifications to it.  For an executable work, complete
  233.      source code means all the source code for all modules it contains,
  234.      plus any associated interface definition files, plus the scripts
  235.      used to control compilation and installation of the executable.
  236.      However, as a special exception, the source code distributed need
  237.      not include anything that is normally distributed (in either
  238.      source or binary form) with the major components (compiler,
  239.      kernel, and so on) of the operating system on which the executable
  240.      runs, unless that component itself accompanies the executable.
  241.  
  242.      If distribution of executable or object code is made by offering
  243.      access to copy from a designated place, then offering equivalent
  244.      access to copy the source code from the same place counts as
  245.      distribution of the source code, even though third parties are not
  246.      compelled to copy the source along with the object code.
  247.  
  248.   4. You may not copy, modify, sublicense, or distribute the Program
  249.      except as expressly provided under this License.  Any attempt
  250.      otherwise to copy, modify, sublicense or distribute the Program is
  251.      void, and will automatically terminate your rights under this
  252.      License.  However, parties who have received copies, or rights,
  253.      from you under this License will not have their licenses
  254.      terminated so long as such parties remain in full compliance.
  255.  
  256.   5. You are not required to accept this License, since you have not
  257.      signed it.  However, nothing else grants you permission to modify
  258.      or distribute the Program or its derivative works.  These actions
  259.      are prohibited by law if you do not accept this License.
  260.      Therefore, by modifying or distributing the Program (or any work
  261.      based on the Program), you indicate your acceptance of this
  262.      License to do so, and all its terms and conditions for copying,
  263.      distributing or modifying the Program or works based on it.
  264.  
  265.   6. Each time you redistribute the Program (or any work based on the
  266.      Program), the recipient automatically receives a license from the
  267.      original licensor to copy, distribute or modify the Program
  268.      subject to these terms and conditions.  You may not impose any
  269.      further restrictions on the recipients' exercise of the rights
  270.      granted herein.  You are not responsible for enforcing compliance
  271.      by third parties to this License.
  272.  
  273.   7. If, as a consequence of a court judgment or allegation of patent
  274.      infringement or for any other reason (not limited to patent
  275.      issues), conditions are imposed on you (whether by court order,
  276.      agreement or otherwise) that contradict the conditions of this
  277.      License, they do not excuse you from the conditions of this
  278.      License.  If you cannot distribute so as to satisfy simultaneously
  279.      your obligations under this License and any other pertinent
  280.      obligations, then as a consequence you may not distribute the
  281.      Program at all.  For example, if a patent license would not permit
  282.      royalty-free redistribution of the Program by all those who
  283.      receive copies directly or indirectly through you, then the only
  284.      way you could satisfy both it and this License would be to refrain
  285.      entirely from distribution of the Program.
  286.  
  287.      If any portion of this section is held invalid or unenforceable
  288.      under any particular circumstance, the balance of the section is
  289.      intended to apply and the section as a whole is intended to apply
  290.      in other circumstances.
  291.  
  292.      It is not the purpose of this section to induce you to infringe any
  293.      patents or other property right claims or to contest validity of
  294.      any such claims; this section has the sole purpose of protecting
  295.      the integrity of the free software distribution system, which is
  296.      implemented by public license practices.  Many people have made
  297.      generous contributions to the wide range of software distributed
  298.      through that system in reliance on consistent application of that
  299.      system; it is up to the author/donor to decide if he or she is
  300.      willing to distribute software through any other system and a
  301.      licensee cannot impose that choice.
  302.  
  303.      This section is intended to make thoroughly clear what is believed
  304.      to be a consequence of the rest of this License.
  305.  
  306.   8. If the distribution and/or use of the Program is restricted in
  307.      certain countries either by patents or by copyrighted interfaces,
  308.      the original copyright holder who places the Program under this
  309.      License may add an explicit geographical distribution limitation
  310.      excluding those countries, so that distribution is permitted only
  311.      in or among countries not thus excluded.  In such case, this
  312.      License incorporates the limitation as if written in the body of
  313.      this License.
  314.  
  315.   9. The Free Software Foundation may publish revised and/or new
  316.      versions of the General Public License from time to time.  Such
  317.      new versions will be similar in spirit to the present version, but
  318.      may differ in detail to address new problems or concerns.
  319.  
  320.      Each version is given a distinguishing version number.  If the
  321.      Program specifies a version number of this License which applies
  322.      to it and "any later version", you have the option of following
  323.      the terms and conditions either of that version or of any later
  324.      version published by the Free Software Foundation.  If the Program
  325.      does not specify a version number of this License, you may choose
  326.      any version ever published by the Free Software Foundation.
  327.  
  328.  10. If you wish to incorporate parts of the Program into other free
  329.      programs whose distribution conditions are different, write to the
  330.      author to ask for permission.  For software which is copyrighted
  331.      by the Free Software Foundation, write to the Free Software
  332.      Foundation; we sometimes make exceptions for this.  Our decision
  333.      will be guided by the two goals of preserving the free status of
  334.      all derivatives of our free software and of promoting the sharing
  335.      and reuse of software generally.
  336.  
  337.                                 NO WARRANTY
  338.  
  339.  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
  340.      WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
  341.      LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
  342.      HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
  343.      WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
  344.      NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  345.      FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE
  346.      QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  347.      PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
  348.      SERVICING, REPAIR OR CORRECTION.
  349.  
  350.  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  351.      WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
  352.      MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
  353.      LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
  354.      INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
  355.      INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
  356.      DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
  357.      OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
  358.      OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
  359.      ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  360.  
  361.                       END OF TERMS AND CONDITIONS
  362.  
  363. How to Apply These Terms to Your New Programs
  364. =============================================
  365.  
  366.    If you develop a new program, and you want it to be of the greatest
  367. possible use to the public, the best way to achieve this is to make it
  368. free software which everyone can redistribute and change under these
  369. terms.
  370.  
  371.    To do so, attach the following notices to the program.  It is safest
  372. to attach them to the start of each source file to most effectively
  373. convey the exclusion of warranty; and each file should have at least
  374. the "copyright" line and a pointer to where the full notice is found.
  375.  
  376.      ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
  377.      Copyright (C) 19YY  NAME OF AUTHOR
  378.      
  379.      This program is free software; you can redistribute it and/or modify
  380.      it under the terms of the GNU General Public License as published by
  381.      the Free Software Foundation; either version 2 of the License, or
  382.      (at your option) any later version.
  383.      
  384.      This program is distributed in the hope that it will be useful,
  385.      but WITHOUT ANY WARRANTY; without even the implied warranty of
  386.      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  387.      GNU General Public License for more details.
  388.      
  389.      You should have received a copy of the GNU General Public License
  390.      along with this program; if not, write to the Free Software
  391.      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  392.  
  393.    Also add information on how to contact you by electronic and paper
  394. mail.
  395.  
  396.    If the program is interactive, make it output a short notice like
  397. this when it starts in an interactive mode:
  398.  
  399.      Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR
  400.      Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
  401.      type `show w'.
  402.      This is free software, and you are welcome to redistribute it
  403.      under certain conditions; type `show c' for details.
  404.  
  405.    The hypothetical commands `show w' and `show c' should show the
  406. appropriate parts of the General Public License.  Of course, the
  407. commands you use may be called something other than `show w' and `show
  408. c'; they could even be mouse-clicks or menu items--whatever suits your
  409. program.
  410.  
  411.    You should also get your employer (if you work as a programmer) or
  412. your school, if any, to sign a "copyright disclaimer" for the program,
  413. if necessary.  Here is a sample; alter the names:
  414.  
  415.      Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  416.      `Gnomovision' (which makes passes at compilers) written by James Hacker.
  417.      
  418.      SIGNATURE OF TY COON, 1 April 1989
  419.      Ty Coon, President of Vice
  420.  
  421.    This General Public License does not permit incorporating your
  422. program into proprietary programs.  If your program is a subroutine
  423. library, you may consider it more useful to permit linking proprietary
  424. applications with the library.  If this is what you want to do, use the
  425. GNU Library General Public License instead of this License.
  426.  
  427. 
  428. File: ^.!gcc.docs.pascal.gpc,  Node: Contributors,  Next: Funding,  Prev: Copying,  Up: Top
  429.  
  430. Contributors to GNU Pascal
  431. **************************
  432.  
  433.    GNU Pascal is the work of Jukka Virtanen.  Several people have
  434. contributed to GNU Pascal.
  435.  
  436.    * Peter Gerwinski wrote the Borland Pascal (and other) extensions to
  437.      GPC.
  438.  
  439.    * Jan Jaap van der Heijden ported GPC to various platforms and wrote
  440.      the auto-configuration scripts.
  441.  
  442.    GNU Pascal is based on GNU CC by Richard Stallman.  Several people
  443. have contributed to GNU CC.
  444.  
  445.    * The idea of using RTL and some of the optimization ideas came from
  446.      the program PO written at the University of Arizona by Jack
  447.      Davidson and Christopher Fraser.  See "Register Allocation and
  448.      Exhaustive Peephole Optimization", Software Practice and
  449.      Experience 14 (9), Sept. 1984, 857-866.
  450.  
  451.    * Paul Rubin wrote most of the preprocessor.
  452.  
  453.    * Leonard Tower wrote parts of the parser, RTL generator, and RTL
  454.      definitions, and of the Vax machine description.
  455.  
  456.    * Ted Lemon wrote parts of the RTL reader and printer.
  457.  
  458.    * Jim Wilson implemented loop strength reduction and some other loop
  459.      optimizations.
  460.  
  461.    * Nobuyuki Hikichi of Software Research Associates, Tokyo,
  462.      contributed the support for the Sony NEWS machine.
  463.  
  464.    * Charles LaBrec contributed the support for the Integrated Solutions
  465.      68020 system.
  466.  
  467.    * Michael Tiemann of Cygnus Support wrote the support for inline
  468.      functions and instruction scheduling.  Also the descriptions of the
  469.      National Semiconductor 32000 series cpu, the SPARC cpu and part of
  470.      the Motorola 88000 cpu.
  471.  
  472.    * Jan Stein of the Chalmers Computer Society provided support for
  473.      Genix, as well as part of the 32000 machine description.
  474.  
  475.    * Randy Smith finished the Sun FPA support.
  476.  
  477.    * Robert Brown implemented the support for Encore 32000 systems.
  478.  
  479.    * David Kashtan of SRI adapted GNU CC to VMS.
  480.  
  481.    * Alex Crain provided changes for the 3b1.
  482.  
  483.    * Greg Satz and Chris Hanson assisted in making GNU CC work on HP-UX
  484.      for the 9000 series 300.
  485.  
  486.    * William Schelter did most of the work on the Intel 80386 support.
  487.  
  488.    * Christopher Smith did the port for Convex machines.
  489.  
  490.    * Paul Petersen wrote the machine description for the Alliant FX/8.
  491.  
  492.    * Dario Dariol contributed the four varieties of sample programs
  493.      that print a copy of their source.
  494.  
  495.    * Alain Lichnewsky ported GNU CC to the Mips cpu.
  496.  
  497.    * Devon Bowen, Dale Wiles and Kevin Zachmann ported GNU CC to the
  498.      Tahoe.
  499.  
  500.    * Jonathan Stone wrote the machine description for the Pyramid
  501.      computer.
  502.  
  503.    * Gary Miller ported GNU CC to Charles River Data Systems machines.
  504.  
  505.    * Richard Kenner of the New York University Ultracomputer Research
  506.      Laboratory wrote the machine descriptions for the AMD 29000, the
  507.      DEC Alpha, the IBM RT PC, and the IBM RS/6000 as well as the
  508.      support for instruction attributes.  He also made changes to
  509.      better support RISC processors including changes to common
  510.      subexpression elimination, strength reduction, function calling
  511.      sequence handling, and condition code support, in addition to
  512.      generalizing the code for frame pointer elimination.
  513.  
  514.    * Richard Kenner and Michael Tiemann jointly developed reorg.c, the
  515.      delay slot scheduler.
  516.  
  517.    * Mike Meissner and Tom Wood of Data General finished the port to the
  518.      Motorola 88000.
  519.  
  520.    * Masanobu Yuhara of Fujitsu Laboratories implemented the machine
  521.      description for the Tron architecture (specifically, the Gmicro).
  522.  
  523.    * James van Artsdalen wrote the code that makes efficient use of the
  524.      Intel 80387 register stack.
  525.  
  526.    * Mike Meissner at the Open Software Foundation finished the port to
  527.      the MIPS cpu, including adding ECOFF debug support, and worked on
  528.      the Intel port for the Intel 80386 cpu.
  529.  
  530.    * Ron Guilmette implemented the `protoize' and `unprotoize' tools,
  531.      the support for Dwarf symbolic debugging information, and much of
  532.      the support for System V Release 4.  He has also worked heavily on
  533.      the Intel 386 and 860 support.
  534.  
  535.    * Torbjorn Granlund implemented multiply- and divide-by-constant
  536.      optimization, improved long long support, and improved leaf
  537.      function register allocation.
  538.  
  539.    * Mike Stump implemented the support for Elxsi 64 bit CPU.
  540.  
  541.    * John Wehle added the machine description for the Western Electric
  542.      32000 processor used in several 3b series machines (no relation to
  543.      the National Semiconductor 32000 processor).
  544.  
  545. 
  546. File: ^.!gcc.docs.pascal.gpc,  Node: Funding,  Next: Look and Feel,  Prev: Contributors,  Up: Top
  547.  
  548. Funding Free Software
  549. *********************
  550.  
  551.    If you want to have more free software a few years from now, it makes
  552. sense for you to help encourage people to contribute funds for its
  553. development.  The most effective approach known is to encourage
  554. commercial redistributors to donate.
  555.  
  556.    Users of free software systems can boost the pace of development by
  557. encouraging for-a-fee distributors to donate part of their selling price
  558. to free software developers--the Free Software Foundation, and others.
  559.  
  560.    The way to convince distributors to do this is to demand it and
  561. expect it from them.  So when you compare distributors, judge them
  562. partly by how much they give to free software development.  Show
  563. distributors they must compete to be the one who gives the most.
  564.  
  565.    To make this approach work, you must insist on numbers that you can
  566. compare, such as, "We will donate ten dollars to the Frobnitz project
  567. for each disk sold."  Don't be satisfied with a vague promise, such as
  568. "A portion of the profits are donated," since it doesn't give a basis
  569. for comparison.
  570.  
  571.    Even a precise fraction "of the profits from this disk" is not very
  572. meaningful, since creative accounting and unrelated business decisions
  573. can greatly alter what fraction of the sales price counts as profit.
  574. If the price you pay is $50, ten percent of the profit is probably less
  575. than a dollar; it might be a few cents, or nothing at all.
  576.  
  577.    Some redistributors do development work themselves.  This is useful
  578. too; but to keep everyone honest, you need to inquire how much they do,
  579. and what kind.  Some kinds of development make much more long-term
  580. difference than others.  For example, maintaining a separate version of
  581. a program contributes very little; maintaining the standard version of a
  582. program for the whole community contributes much.  Easy new ports
  583. contribute little, since someone else would surely do them; difficult
  584. ports such as adding a new CPU to the GNU C compiler contribute more;
  585. major new features or packages contribute the most.
  586.  
  587.    By establishing the idea that supporting further development is "the
  588. proper thing to do" when distributing free software for a fee, we can
  589. assure a steady flow of resources into making more free software.
  590.  
  591.      Copyright (C) 1994 Free Software Foundation, Inc.
  592.      Verbatim copying and redistribution of this section is permitted
  593.      without royalty; alteration is not permitted.
  594.  
  595. 
  596. File: ^.!gcc.docs.pascal.gpc,  Node: Look and Feel,  Next: Manifesto,  Prev: Funding,  Up: Top
  597.  
  598. Protect Your Freedom--Fight "Look And Feel"
  599. *******************************************
  600.  
  601.      This section is a political message from the League for Programming
  602.      Freedom to the users of GNU CC.  We have included it here because
  603.      the issue of interface copyright is important to the GNU project.
  604.  
  605.    Apple, Lotus, and now CDC have tried to create a new form of legal
  606. monopoly: a copyright on a user interface.
  607.  
  608.    An interface is a kind of language--a set of conventions for
  609. communication between two entities, human or machine.  Until a few years
  610. ago, the law seemed clear: interfaces were outside the domain of
  611. copyright, so programmers could program freely and implement whatever
  612. interface the users demanded.  Imitating de-facto standard interfaces,
  613. sometimes with improvements, was standard practice in the computer
  614. field.  These improvements, if accepted by the users, caught on and
  615. became the norm; in this way, much progress took place.
  616.  
  617.    Computer users, and most software developers, were happy with this
  618. state of affairs.  However, large companies such as Apple and Lotus
  619. would prefer a different system--one in which they can own interfaces
  620. and thereby rid themselves of all serious competitors.  They hope that
  621. interface copyright will give them, in effect, monopolies on major
  622. classes of software.
  623.  
  624.    Other large companies such as IBM and Digital also favor interface
  625. monopolies, for the same reason: if languages become property, they
  626. expect to own many de-facto standard languages.  But Apple and Lotus are
  627. the ones who have actually sued.  Apple's lawsuit was defeated, for
  628. reasons only partly related to the general issue of interface copyright.
  629.  
  630.    Lotus won lawsuits against two small companies, which were thus put
  631. out of business.  Then they sued Borland; they won in the trial court
  632. (no surprise, since it was the same court that had ruled for Lotus twice
  633. before), but the decision was reversed by the court of appeals, with
  634. help from the League for Programming Freedom in the form of a
  635. friend-of-the-court brief.  We are now waiting to see if the Supreme
  636. Court will hear the case.  If it does, the League for Programming
  637. Freedom will again submit a brief.
  638.  
  639.    The battle is not over.  Just this summer a company that produced a
  640. simulator for a CDC computer was shut down by a copyright lawsuit by
  641. CDC, which charged that the simulator infringed the copyright on the
  642. manuals for the computer.
  643.  
  644.    If the monopolists get their way, they will hobble the software
  645. field:
  646.  
  647.    * Gratuitous incompatibilities will burden users.  Imagine if each
  648.      car manufacturer had to design a different way to start, stop, and
  649.      steer a car.
  650.  
  651.    * Users will be "locked in" to whichever interface they learn; then
  652.      they will be prisoners of one supplier, who will charge a
  653.      monopolistic price.
  654.  
  655.    * Large companies have an unfair advantage wherever lawsuits become
  656.      commonplace.  Since they can afford to sue, they can intimidate
  657.      smaller developers with threats even when they don't really have a
  658.      case.
  659.  
  660.    * Interface improvements will come slower, since incremental
  661.      evolution through creative partial imitation will no longer occur.
  662.  
  663.    If interface monopolies are accepted, other large companies are
  664. waiting to grab theirs:
  665.  
  666.    * Adobe is expected to claim a monopoly on the interfaces of various
  667.      popular application programs, if Lotus ultimately wins the case
  668.      against Borland.
  669.  
  670.    * Open Computing magazine reported a Microsoft vice president as
  671.      threatening to sue people who imitate the interface of Windows.
  672.  
  673.    Users invest a great deal of time and money in learning to use
  674. computer interfaces.  Far more, in fact, than software developers
  675. invest in developing *and even implementing* the interfaces.  Whoever
  676. can own an interface, has made its users into captives, and
  677. misappropriated their investment.
  678.  
  679.    To protect our freedom from monopolies like these, a group of
  680. programmers and users have formed a grass-roots political organization,
  681. the League for Programming Freedom.
  682.  
  683.    The purpose of the League is to oppose monopolistic practices such as
  684. interface copyright and software patents.  The League calls for a return
  685. to the legal policies of the recent past, in which programmers could
  686. program freely.  The League is not concerned with free software as an
  687. issue, and is not affiliated with the Free Software Foundation.
  688.  
  689.    The League's activities include publicizing the issues, as is being
  690. done here, and filing friend-of-the-court briefs on behalf of
  691. defendants sued by monopolists.
  692.  
  693.    The League's membership rolls include Donald Knuth, the foremost
  694. authority on algorithms, John McCarthy, inventor of Lisp, Marvin Minsky,
  695. founder of the MIT Artificial Intelligence lab, Guy L.  Steele, Jr.,
  696. author of well-known books on Lisp and C, as well as Richard Stallman,
  697. the developer of GNU CC.  Please join and add your name to the list.
  698. Membership dues in the League are $42 per year for programmers, managers
  699. and professionals; $10.50 for students; $21 for others.
  700.  
  701.    Activist members are especially important, but members who have no
  702. time to give are also important.  Surveys at major ACM conferences have
  703. indicated a vast majority of attendees agree with the League on both
  704. issues (interface copyrights and software patents).  If just ten percent
  705. of the programmers who agree with the League join the League, we will
  706. probably triumph.
  707.  
  708.    To join, or for more information, phone (617) 243-4091 or write to:
  709.  
  710.      League for Programming Freedom
  711.      1 Kendall Square #143
  712.      P.O. Box 9171
  713.      Cambridge, MA 02139
  714.  
  715.    You can also send electronic mail to `lpf@uunet.uu.net'.
  716.  
  717.    In addition to joining the League, here are some suggestions from the
  718. League for other things you can do to protect your freedom to write
  719. programs:
  720.  
  721.    * Tell your friends and colleagues about this issue and how it
  722.      threatens to ruin the computer industry.
  723.  
  724.    * Mention that you are a League member in your `.signature', and
  725.      mention the League's email address for inquiries.
  726.  
  727.    * Ask the companies you consider working for or working with to make
  728.      statements against software monopolies, and give preference to
  729.      those that do.
  730.  
  731.    * When employers ask you to sign contracts giving them copyright on
  732.      your work, insist on a clause saying they will not claim the
  733.      copyright covers imitating the interface.
  734.  
  735.    * When employers ask you to sign contracts giving them patent rights,
  736.      insist on clauses saying they can use these rights only
  737.      defensively.  Don't rely on "company policy," since that can
  738.      change at any time; don't rely on an individual executive's
  739.      private word, since that person may be replaced.  Get a commitment
  740.      just as binding as the commitment they get from you.
  741.  
  742.    * Write to Congress to explain the importance of these issues.
  743.  
  744.           House Subcommittee on Intellectual Property
  745.           2137 Rayburn Bldg
  746.           Washington, DC 20515
  747.           
  748.           Senate Subcommittee on Patents, Trademarks and Copyrights
  749.           United States Senate
  750.           Washington, DC 20510
  751.  
  752.      (These committees have received lots of mail already; let's give
  753.      them even more.)
  754.  
  755.    Democracy means nothing if you don't use it.  Stand up and be
  756. counted!
  757.  
  758. 
  759. File: ^.!gcc.docs.pascal.gpc,  Node: Manifesto,  Next: Purpose,  Prev: Look and Feel,  Up: Top
  760.  
  761. The GNU Manifesto
  762. *****************
  763.  
  764.      The GNU Manifesto which appears below was written by Richard
  765.      Stallman at the beginning of the GNU project, to ask for
  766.      participation and support.  For the first few years, it was
  767.      updated in minor ways to account for developments, but now it
  768.      seems best to leave it unchanged as most people have seen it.
  769.  
  770.      Since that time, we have learned about certain common
  771.      misunderstandings that different wording could help avoid.
  772.      Footnotes added in 1993 help clarify these points.
  773.  
  774.      For up-to-date information about the available GNU software,
  775.      please see the latest issue of the GNU's Bulletin.  The list is
  776.      much too long to include here.
  777.  
  778. What's GNU?  Gnu's Not Unix!
  779. ============================
  780.  
  781.    GNU, which stands for Gnu's Not Unix, is the name for the complete
  782. Unix-compatible software system which I am writing so that I can give it
  783. away free to everyone who can use it.(1) Several other volunteers are
  784. helping me.  Contributions of time, money, programs and equipment are
  785. greatly needed.
  786.  
  787.    So far we have an Emacs text editor with Lisp for writing editor
  788. commands, a source level debugger, a yacc-compatible parser generator,
  789. a linker, and around 35 utilities.  A shell (command interpreter) is
  790. nearly completed.  A new portable optimizing C compiler has compiled
  791. itself and may be released this year.  An initial kernel exists but
  792. many more features are needed to emulate Unix.  When the kernel and
  793. compiler are finished, it will be possible to distribute a GNU system
  794. suitable for program development.  We will use TeX as our text
  795. formatter, but an nroff is being worked on.  We will use the free,
  796. portable X window system as well.  After this we will add a portable
  797. Common Lisp, an Empire game, a spreadsheet, and hundreds of other
  798. things, plus on-line documentation.  We hope to supply, eventually,
  799. everything useful that normally comes with a Unix system, and more.
  800.  
  801.    GNU will be able to run Unix programs, but will not be identical to
  802. Unix.  We will make all improvements that are convenient, based on our
  803. experience with other operating systems.  In particular, we plan to
  804. have longer file names, file version numbers, a crashproof file system,
  805. file name completion perhaps, terminal-independent display support, and
  806. perhaps eventually a Lisp-based window system through which several
  807. Lisp programs and ordinary Unix programs can share a screen.  Both C
  808. and Lisp will be available as system programming languages.  We will
  809. try to support UUCP, MIT Chaosnet, and Internet protocols for
  810. communication.
  811.  
  812.    GNU is aimed initially at machines in the 68000/16000 class with
  813. virtual memory, because they are the easiest machines to make it run
  814. on.  The extra effort to make it run on smaller machines will be left
  815. to someone who wants to use it on them.
  816.  
  817.    To avoid horrible confusion, please pronounce the `G' in the word
  818. `GNU' when it is the name of this project.
  819.  
  820. Why I Must Write GNU
  821. ====================
  822.  
  823.    I consider that the golden rule requires that if I like a program I
  824. must share it with other people who like it.  Software sellers want to
  825. divide the users and conquer them, making each user agree not to share
  826. with others.  I refuse to break solidarity with other users in this
  827. way.  I cannot in good conscience sign a nondisclosure agreement or a
  828. software license agreement.  For years I worked within the Artificial
  829. Intelligence Lab to resist such tendencies and other inhospitalities,
  830. but eventually they had gone too far: I could not remain in an
  831. institution where such things are done for me against my will.
  832.  
  833.    So that I can continue to use computers without dishonor, I have
  834. decided to put together a sufficient body of free software so that I
  835. will be able to get along without any software that is not free.  I
  836. have resigned from the AI lab to deny MIT any legal excuse to prevent
  837. me from giving GNU away.
  838.  
  839. Why GNU Will Be Compatible with Unix
  840. ====================================
  841.  
  842.    Unix is not my ideal system, but it is not too bad.  The essential
  843. features of Unix seem to be good ones, and I think I can fill in what
  844. Unix lacks without spoiling them.  And a system compatible with Unix
  845. would be convenient for many other people to adopt.
  846.  
  847. How GNU Will Be Available
  848. =========================
  849.  
  850.    GNU is not in the public domain.  Everyone will be permitted to
  851. modify and redistribute GNU, but no distributor will be allowed to
  852. restrict its further redistribution.  That is to say, proprietary
  853. modifications will not be allowed.  I want to make sure that all
  854. versions of GNU remain free.
  855.  
  856. Why Many Other Programmers Want to Help
  857. =======================================
  858.  
  859.    I have found many other programmers who are excited about GNU and
  860. want to help.
  861.  
  862.    Many programmers are unhappy about the commercialization of system
  863. software.  It may enable them to make more money, but it requires them
  864. to feel in conflict with other programmers in general rather than feel
  865. as comrades.  The fundamental act of friendship among programmers is the
  866. sharing of programs; marketing arrangements now typically used
  867. essentially forbid programmers to treat others as friends.  The
  868. purchaser of software must choose between friendship and obeying the
  869. law.  Naturally, many decide that friendship is more important.  But
  870. those who believe in law often do not feel at ease with either choice.
  871. They become cynical and think that programming is just a way of making
  872. money.
  873.  
  874.    By working on and using GNU rather than proprietary programs, we can
  875. be hospitable to everyone and obey the law.  In addition, GNU serves as
  876. an example to inspire and a banner to rally others to join us in
  877. sharing.  This can give us a feeling of harmony which is impossible if
  878. we use software that is not free.  For about half the programmers I
  879. talk to, this is an important happiness that money cannot replace.
  880.  
  881. How You Can Contribute
  882. ======================
  883.  
  884.    I am asking computer manufacturers for donations of machines and
  885. money.  I'm asking individuals for donations of programs and work.
  886.  
  887.    One consequence you can expect if you donate machines is that GNU
  888. will run on them at an early date.  The machines should be complete,
  889. ready to use systems, approved for use in a residential area, and not
  890. in need of sophisticated cooling or power.
  891.  
  892.    I have found very many programmers eager to contribute part-time
  893. work for GNU.  For most projects, such part-time distributed work would
  894. be very hard to coordinate; the independently-written parts would not
  895. work together.  But for the particular task of replacing Unix, this
  896. problem is absent.  A complete Unix system contains hundreds of utility
  897. programs, each of which is documented separately.  Most interface
  898. specifications are fixed by Unix compatibility.  If each contributor
  899. can write a compatible replacement for a single Unix utility, and make
  900. it work properly in place of the original on a Unix system, then these
  901. utilities will work right when put together.  Even allowing for Murphy
  902. to create a few unexpected problems, assembling these components will
  903. be a feasible task.  (The kernel will require closer communication and
  904. will be worked on by a small, tight group.)
  905.  
  906.    If I get donations of money, I may be able to hire a few people full
  907. or part time.  The salary won't be high by programmers' standards, but
  908. I'm looking for people for whom building community spirit is as
  909. important as making money.  I view this as a way of enabling dedicated
  910. people to devote their full energies to working on GNU by sparing them
  911. the need to make a living in another way.
  912.  
  913. Why All Computer Users Will Benefit
  914. ===================================
  915.  
  916.    Once GNU is written, everyone will be able to obtain good system
  917. software free, just like air.(2)
  918.  
  919.    This means much more than just saving everyone the price of a Unix
  920. license.  It means that much wasteful duplication of system programming
  921. effort will be avoided.  This effort can go instead into advancing the
  922. state of the art.
  923.  
  924.    Complete system sources will be available to everyone.  As a result,
  925. a user who needs changes in the system will always be free to make them
  926. himself, or hire any available programmer or company to make them for
  927. him.  Users will no longer be at the mercy of one programmer or company
  928. which owns the sources and is in sole position to make changes.
  929.  
  930.    Schools will be able to provide a much more educational environment
  931. by encouraging all students to study and improve the system code.
  932. Harvard's computer lab used to have the policy that no program could be
  933. installed on the system if its sources were not on public display, and
  934. upheld it by actually refusing to install certain programs.  I was very
  935. much inspired by this.
  936.  
  937.    Finally, the overhead of considering who owns the system software
  938. and what one is or is not entitled to do with it will be lifted.
  939.  
  940.    Arrangements to make people pay for using a program, including
  941. licensing of copies, always incur a tremendous cost to society through
  942. the cumbersome mechanisms necessary to figure out how much (that is,
  943. which programs) a person must pay for.  And only a police state can
  944. force everyone to obey them.  Consider a space station where air must
  945. be manufactured at great cost: charging each breather per liter of air
  946. may be fair, but wearing the metered gas mask all day and all night is
  947. intolerable even if everyone can afford to pay the air bill.  And the
  948. TV cameras everywhere to see if you ever take the mask off are
  949. outrageous.  It's better to support the air plant with a head tax and
  950. chuck the masks.
  951.  
  952.    Copying all or parts of a program is as natural to a programmer as
  953. breathing, and as productive.  It ought to be as free.
  954.  
  955. Some Easily Rebutted Objections to GNU's Goals
  956. ==============================================
  957.  
  958.      "Nobody will use it if it is free, because that means they can't
  959.      rely on any support."
  960.  
  961.      "You have to charge for the program to pay for providing the
  962.      support."
  963.  
  964.    If people would rather pay for GNU plus service than get GNU free
  965. without service, a company to provide just service to people who have
  966. obtained GNU free ought to be profitable.(3)
  967.  
  968.    We must distinguish between support in the form of real programming
  969. work and mere handholding.  The former is something one cannot rely on
  970. from a software vendor.  If your problem is not shared by enough
  971. people, the vendor will tell you to get lost.
  972.  
  973.    If your business needs to be able to rely on support, the only way
  974. is to have all the necessary sources and tools.  Then you can hire any
  975. available person to fix your problem; you are not at the mercy of any
  976. individual.  With Unix, the price of sources puts this out of
  977. consideration for most businesses.  With GNU this will be easy.  It is
  978. still possible for there to be no available competent person, but this
  979. problem cannot be blamed on distribution arrangements.  GNU does not
  980. eliminate all the world's problems, only some of them.
  981.  
  982.    Meanwhile, the users who know nothing about computers need
  983. handholding: doing things for them which they could easily do
  984. themselves but don't know how.
  985.  
  986.    Such services could be provided by companies that sell just
  987. hand-holding and repair service.  If it is true that users would rather
  988. spend money and get a product with service, they will also be willing
  989. to buy the service having got the product free.  The service companies
  990. will compete in quality and price; users will not be tied to any
  991. particular one.  Meanwhile, those of us who don't need the service
  992. should be able to use the program without paying for the service.
  993.  
  994.      "You cannot reach many people without advertising, and you must
  995.      charge for the program to support that."
  996.  
  997.      "It's no use advertising a program people can get free."
  998.  
  999.    There are various forms of free or very cheap publicity that can be
  1000. used to inform numbers of computer users about something like GNU.  But
  1001. it may be true that one can reach more microcomputer users with
  1002. advertising.  If this is really so, a business which advertises the
  1003. service of copying and mailing GNU for a fee ought to be successful
  1004. enough to pay for its advertising and more.  This way, only the users
  1005. who benefit from the advertising pay for it.
  1006.  
  1007.    On the other hand, if many people get GNU from their friends, and
  1008. such companies don't succeed, this will show that advertising was not
  1009. really necessary to spread GNU.  Why is it that free market advocates
  1010. don't want to let the free market decide this?(4)
  1011.  
  1012.      "My company needs a proprietary operating system to get a
  1013.      competitive edge."
  1014.  
  1015.    GNU will remove operating system software from the realm of
  1016. competition.  You will not be able to get an edge in this area, but
  1017. neither will your competitors be able to get an edge over you.  You and
  1018. they will compete in other areas, while benefiting mutually in this
  1019. one.  If your business is selling an operating system, you will not
  1020. like GNU, but that's tough on you.  If your business is something else,
  1021. GNU can save you from being pushed into the expensive business of
  1022. selling operating systems.
  1023.  
  1024.    I would like to see GNU development supported by gifts from many
  1025. manufacturers and users, reducing the cost to each.(5)
  1026.  
  1027.      "Don't programmers deserve a reward for their creativity?"
  1028.  
  1029.    If anything deserves a reward, it is social contribution.
  1030. Creativity can be a social contribution, but only in so far as society
  1031. is free to use the results.  If programmers deserve to be rewarded for
  1032. creating innovative programs, by the same token they deserve to be
  1033. punished if they restrict the use of these programs.
  1034.  
  1035.      "Shouldn't a programmer be able to ask for a reward for his
  1036.      creativity?"
  1037.  
  1038.    There is nothing wrong with wanting pay for work, or seeking to
  1039. maximize one's income, as long as one does not use means that are
  1040. destructive.  But the means customary in the field of software today
  1041. are based on destruction.
  1042.  
  1043.    Extracting money from users of a program by restricting their use of
  1044. it is destructive because the restrictions reduce the amount and the
  1045. ways that the program can be used.  This reduces the amount of wealth
  1046. that humanity derives from the program.  When there is a deliberate
  1047. choice to restrict, the harmful consequences are deliberate destruction.
  1048.  
  1049.    The reason a good citizen does not use such destructive means to
  1050. become wealthier is that, if everyone did so, we would all become
  1051. poorer from the mutual destructiveness.  This is Kantian ethics; or,
  1052. the Golden Rule.  Since I do not like the consequences that result if
  1053. everyone hoards information, I am required to consider it wrong for one
  1054. to do so.  Specifically, the desire to be rewarded for one's creativity
  1055. does not justify depriving the world in general of all or part of that
  1056. creativity.
  1057.  
  1058.      "Won't programmers starve?"
  1059.  
  1060.    I could answer that nobody is forced to be a programmer.  Most of us
  1061. cannot manage to get any money for standing on the street and making
  1062. faces.  But we are not, as a result, condemned to spend our lives
  1063. standing on the street making faces, and starving.  We do something
  1064. else.
  1065.  
  1066.    But that is the wrong answer because it accepts the questioner's
  1067. implicit assumption: that without ownership of software, programmers
  1068. cannot possibly be paid a cent.  Supposedly it is all or nothing.
  1069.  
  1070.    The real reason programmers will not starve is that it will still be
  1071. possible for them to get paid for programming; just not paid as much as
  1072. now.
  1073.  
  1074.    Restricting copying is not the only basis for business in software.
  1075. It is the most common basis because it brings in the most money.  If it
  1076. were prohibited, or rejected by the customer, software business would
  1077. move to other bases of organization which are now used less often.
  1078. There are always numerous ways to organize any kind of business.
  1079.  
  1080.    Probably programming will not be as lucrative on the new basis as it
  1081. is now.  But that is not an argument against the change.  It is not
  1082. considered an injustice that sales clerks make the salaries that they
  1083. now do.  If programmers made the same, that would not be an injustice
  1084. either.  (In practice they would still make considerably more than
  1085. that.)
  1086.  
  1087.      "Don't people have a right to control how their creativity is
  1088.      used?"
  1089.  
  1090.    "Control over the use of one's ideas" really constitutes control over
  1091. other people's lives; and it is usually used to make their lives more
  1092. difficult.
  1093.  
  1094.    People who have studied the issue of intellectual property rights
  1095. carefully (such as lawyers) say that there is no intrinsic right to
  1096. intellectual property.  The kinds of supposed intellectual property
  1097. rights that the government recognizes were created by specific acts of
  1098. legislation for specific purposes.
  1099.  
  1100.    For example, the patent system was established to encourage
  1101. inventors to disclose the details of their inventions.  Its purpose was
  1102. to help society rather than to help inventors.  At the time, the life
  1103. span of 17 years for a patent was short compared with the rate of
  1104. advance of the state of the art.  Since patents are an issue only among
  1105. manufacturers, for whom the cost and effort of a license agreement are
  1106. small compared with setting up production, the patents often do not do
  1107. much harm.  They do not obstruct most individuals who use patented
  1108. products.
  1109.  
  1110.    The idea of copyright did not exist in ancient times, when authors
  1111. frequently copied other authors at length in works of non-fiction.  This
  1112. practice was useful, and is the only way many authors' works have
  1113. survived even in part.  The copyright system was created expressly for
  1114. the purpose of encouraging authorship.  In the domain for which it was
  1115. invented--books, which could be copied economically only on a printing
  1116. press--it did little harm, and did not obstruct most of the individuals
  1117. who read the books.
  1118.  
  1119.    All intellectual property rights are just licenses granted by society
  1120. because it was thought, rightly or wrongly, that society as a whole
  1121. would benefit by granting them.  But in any particular situation, we
  1122. have to ask: are we really better off granting such license?  What kind
  1123. of act are we licensing a person to do?
  1124.  
  1125.    The case of programs today is very different from that of books a
  1126. hundred years ago.  The fact that the easiest way to copy a program is
  1127. from one neighbor to another, the fact that a program has both source
  1128. code and object code which are distinct, and the fact that a program is
  1129. used rather than read and enjoyed, combine to create a situation in
  1130. which a person who enforces a copyright is harming society as a whole
  1131. both materially and spiritually; in which a person should not do so
  1132. regardless of whether the law enables him to.
  1133.  
  1134.      "Competition makes things get done better."
  1135.  
  1136.    The paradigm of competition is a race: by rewarding the winner, we
  1137. encourage everyone to run faster.  When capitalism really works this
  1138. way, it does a good job; but its defenders are wrong in assuming it
  1139. always works this way.  If the runners forget why the reward is offered
  1140. and become intent on winning, no matter how, they may find other
  1141. strategies--such as, attacking other runners.  If the runners get into
  1142. a fist fight, they will all finish late.
  1143.  
  1144.    Proprietary and secret software is the moral equivalent of runners
  1145. in a fist fight.  Sad to say, the only referee we've got does not seem
  1146. to object to fights; he just regulates them ("For every ten yards you
  1147. run, you can fire one shot").  He really ought to break them up, and
  1148. penalize runners for even trying to fight.
  1149.  
  1150.      "Won't everyone stop programming without a monetary incentive?"
  1151.  
  1152.    Actually, many people will program with absolutely no monetary
  1153. incentive.  Programming has an irresistible fascination for some
  1154. people, usually the people who are best at it.  There is no shortage of
  1155. professional musicians who keep at it even though they have no hope of
  1156. making a living that way.
  1157.  
  1158.    But really this question, though commonly asked, is not appropriate
  1159. to the situation.  Pay for programmers will not disappear, only become
  1160. less.  So the right question is, will anyone program with a reduced
  1161. monetary incentive?  My experience shows that they will.
  1162.  
  1163.    For more than ten years, many of the world's best programmers worked
  1164. at the Artificial Intelligence Lab for far less money than they could
  1165. have had anywhere else.  They got many kinds of non-monetary rewards:
  1166. fame and appreciation, for example.  And creativity is also fun, a
  1167. reward in itself.
  1168.  
  1169.    Then most of them left when offered a chance to do the same
  1170. interesting work for a lot of money.
  1171.  
  1172.    What the facts show is that people will program for reasons other
  1173. than riches; but if given a chance to make a lot of money as well, they
  1174. will come to expect and demand it.  Low-paying organizations do poorly
  1175. in competition with high-paying ones, but they do not have to do badly
  1176. if the high-paying ones are banned.
  1177.  
  1178.      "We need the programmers desperately.  If they demand that we stop
  1179.      helping our neighbors, we have to obey."
  1180.  
  1181.    You're never so desperate that you have to obey this sort of demand.
  1182. Remember: millions for defense, but not a cent for tribute!
  1183.  
  1184.      "Programmers need to make a living somehow."
  1185.  
  1186.    In the short run, this is true.  However, there are plenty of ways
  1187. that programmers could make a living without selling the right to use a
  1188. program.  This way is customary now because it brings programmers and
  1189. businessmen the most money, not because it is the only way to make a
  1190. living.  It is easy to find other ways if you want to find them.  Here
  1191. are a number of examples.
  1192.  
  1193.    A manufacturer introducing a new computer will pay for the porting of
  1194. operating systems onto the new hardware.
  1195.  
  1196.    The sale of teaching, hand-holding and maintenance services could
  1197. also employ programmers.
  1198.  
  1199.    People with new ideas could distribute programs as freeware, asking
  1200. for donations from satisfied users, or selling hand-holding services.
  1201. I have met people who are already working this way successfully.
  1202.  
  1203.    Users with related needs can form users' groups, and pay dues.  A
  1204. group would contract with programming companies to write programs that
  1205. the group's members would like to use.
  1206.  
  1207.    All sorts of development can be funded with a Software Tax:
  1208.  
  1209.      Suppose everyone who buys a computer has to pay x percent of the
  1210.      price as a software tax.  The government gives this to an agency
  1211.      like the NSF to spend on software development.
  1212.  
  1213.      But if the computer buyer makes a donation to software development
  1214.      himself, he can take a credit against the tax.  He can donate to
  1215.      the project of his own choosing--often, chosen because he hopes to
  1216.      use the results when it is done.  He can take a credit for any
  1217.      amount of donation up to the total tax he had to pay.
  1218.  
  1219.      The total tax rate could be decided by a vote of the payers of the
  1220.      tax, weighted according to the amount they will be taxed on.
  1221.  
  1222.      The consequences:
  1223.  
  1224.         * The computer-using community supports software development.
  1225.  
  1226.         * This community decides what level of support is needed.
  1227.  
  1228.         * Users who care which projects their share is spent on can
  1229.           choose this for themselves.
  1230.  
  1231.    In the long run, making programs free is a step toward the
  1232. post-scarcity world, where nobody will have to work very hard just to
  1233. make a living.  People will be free to devote themselves to activities
  1234. that are fun, such as programming, after spending the necessary ten
  1235. hours a week on required tasks such as legislation, family counseling,
  1236. robot repair and asteroid prospecting.  There will be no need to be
  1237. able to make a living from programming.
  1238.  
  1239.    We have already greatly reduced the amount of work that the whole
  1240. society must do for its actual productivity, but only a little of this
  1241. has translated itself into leisure for workers because much
  1242. nonproductive activity is required to accompany productive activity.
  1243. The main causes of this are bureaucracy and isometric struggles against
  1244. competition.  Free software will greatly reduce these drains in the
  1245. area of software production.  We must do this, in order for technical
  1246. gains in productivity to translate into less work for us.
  1247.  
  1248.    ---------- Footnotes ----------
  1249.  
  1250.    (1)  The wording here was careless.  The intention was that nobody
  1251. would have to pay for *permission* to use the GNU system.  But the
  1252. words don't make this clear, and people often interpret them as saying
  1253. that copies of GNU should always be distributed at little or no charge.
  1254. That was never the intent; later on, the manifesto mentions the
  1255. possibility of companies providing the service of distribution for a
  1256. profit.  Subsequently I have learned to distinguish carefully between
  1257. "free" in the sense of freedom and "free" in the sense of price.  Free
  1258. software is software that users have the freedom to distribute and
  1259. change.  Some users may obtain copies at no charge, while others pay to
  1260. obtain copies--and if the funds help support improving the software, so
  1261. much the better.  The important thing is that everyone who has a copy
  1262. has the freedom to cooperate with others in using it.
  1263.  
  1264.    (2)  This is another place I failed to distinguish carefully between
  1265. the two different meanings of "free".  The statement as it stands is
  1266. not false--you can get copies of GNU software at no charge, from your
  1267. friends or over the net.  But it does suggest the wrong idea.
  1268.  
  1269.    (3)  Several such companies now exist.
  1270.  
  1271.    (4)  The Free Software Foundation raises most of its funds from a
  1272. distribution service, although it is a charity rather than a company.
  1273. If *no one* chooses to obtain copies by ordering from the FSF, it will
  1274. be unable to do its work.  But this does not mean that proprietary
  1275. restrictions are justified to force every user to pay.  If a small
  1276. fraction of all the users order copies from the FSF, that is sufficient
  1277. to keep the FSF afloat.  So we ask users to choose to support us in
  1278. this way.  Have you done your part?
  1279.  
  1280.    (5)  A group of computer companies recently pooled funds to support
  1281. maintenance of the GNU C Compiler.
  1282.  
  1283. 
  1284. File: ^.!gcc.docs.pascal.gpc,  Node: Purpose,  Next: Installation,  Prev: Manifesto,  Up: Top
  1285.  
  1286. The Purpose of GNU Pascal
  1287. *************************
  1288.  
  1289.    The purpose of the GNU Pascal project is to produce a Pascal compiler
  1290. (called GNU Pascal or GPC) which
  1291.  
  1292.    * combines the clarity of Pascal with powerful tools suitable for
  1293.      real-life programming,
  1294.  
  1295.    * supports both the Pascal standard and the Extended Pascal standard
  1296.      as defined by ISO, ANSI and IEEE. (ISO 7185:1990, ISO/IEC
  1297.      10206:1991, ANSI/IEEE 770X3.160-1989)
  1298.  
  1299.    * supports other Pascal standards (UCSD Pascal, Borland Pascal,
  1300.      Pascal-SC) in so far as this serves the goal of clarity and
  1301.      usability,
  1302.  
  1303.    * may be distributed under normal GNU license conditions
  1304.  
  1305.    * can generate code and run on any computer for which the GNU C
  1306.      compiler can generate code and run.
  1307.  
  1308.    Pascal was originally designed for teaching.  GNU Pascal provides a
  1309. smooth way to proceed to challenging programming tasks without learning
  1310. a completely different language.
  1311.  
  1312.    GNU Pascal compiler is part of the GNU Compiler family combining a
  1313. language independent part of the GNU Compiler with a Pascal specific
  1314. front end.
  1315.  
  1316.    Other compilers of the family currently include compilers for the C,
  1317. C++ and Objective C languages.
  1318.  
  1319. 
  1320. File: ^.!gcc.docs.pascal.gpc,  Node: Installation,  Next: Invoking GPC,  Prev: Purpose,  Up: Top
  1321.  
  1322. Installing GNU Pascal
  1323. *********************
  1324.  
  1325.    This chapter covers:
  1326.    * Installation instructions for a GPC binary distribution
  1327.  
  1328.    * Compilation of the source distribution on a UNIX system
  1329.  
  1330.    * Problems
  1331.  
  1332.    The preferred way to distribute GNU software is distribution of the
  1333. source code.  However it is nontrivial to compile GNU Pascal on non-UNIX
  1334. systems, so we also provide ready-to-run binaries for the following
  1335. platforms:
  1336.  
  1337.    * DJGPP for DOS (you need DJGPP v2.0 installed),
  1338.  
  1339.    * EMX for DOS and OS/2 (you need the EMX extender),
  1340.  
  1341.    * cygwin32 for Windows 95/NT, and
  1342.  
  1343.    * Linux.
  1344.  
  1345.    To install a binary distribution, cd to the main directory and
  1346. unpack the archive while preserving the stored directory structure.  In
  1347. concrete, to install a ZIP archive under DOS with PKunzip, type
  1348.  
  1349.        C:\> pkunzip -d ARCHIVE
  1350.  
  1351.    where ARCHIVE is the name of the distribution file.  To install a
  1352. TGZ archive under Linux, become root, then extract the archive from the
  1353. root of the filesystem:
  1354.  
  1355.        # tar xzf ARCHIVE.tar.gz
  1356.  
  1357.    Binary distributions include `libgcc.' and `specs', files that are
  1358. normally part of gcc. If you have gcc installed, they will be replaced
  1359. unless you manually install the archive.
  1360.  
  1361.    Compilation instructions for the different platforms and more about
  1362. the extenders mentioned above follow.
  1363.  
  1364. * Menu:
  1365.  
  1366. * UNIX::            Installation on a UNIX system
  1367. * DOS: DJGPP.       The DJGPP port of GNU compilers to MS-DOS
  1368. * DOS, OS/2: EMX.   The EMX port of GNU compilers to MS-DOS and OS/2
  1369. * Win32::           Installation on a Windows 95/NT system
  1370. * Cross-Compiler::  Building and installing a cross-compiler.
  1371.  
  1372. 
  1373. File: ^.!gcc.docs.pascal.gpc,  Node: UNIX,  Next: DJGPP,  Up: Installation
  1374.  
  1375. Installation on a UNIX system
  1376. =============================
  1377.  
  1378.    GPC is based on GNU CC; you will need the GCC sources to build it.
  1379. It must be the same version as the one GPC is implemented with.
  1380. Although you need GCC to build the GNU Pascal compiler, you don't need
  1381. GCC to compile Pascal programs once GNU Pascal is installed.
  1382.  
  1383.    Here is the generic procedure for installing GNU Pascal on a Unix
  1384. system.  See *Note System V:: for System V compatible unices (e.g.
  1385. Linux), *Note Alpha OSF/1:: for Alpha OSF/1 systems.
  1386.  
  1387.   1. Unpack source distributions.
  1388.  
  1389.      Sources for GNU CC and GNU Pascal must be unpacked in separate
  1390.      directories.  It is possible, though not required, to build the
  1391.      compiler(s) in a directory other than the one containing the
  1392.      sources. In either case, you need a `make' that understands the
  1393.      VPATH variable. GNU make does, although at least GNU make version
  1394.      3.71 has a bug in the way it treats VPATH.  GNU make version 3.74
  1395.      is known to work.
  1396.  
  1397.      XREF See the section problems.
  1398.  
  1399.      If you have built GNU Pascal previously in the same directory for a
  1400.      different target machine, do `make distclean' to delete all files
  1401.      that might be invalid.  One of the files this deletes is
  1402.      `Makefile'; if `make distclean' complains that `Makefile' does not
  1403.      exist, it probably means that the directory is already suitably
  1404.      clean.
  1405.  
  1406.   2. Configure and build GNU CC Chdir to the GCC object directory and
  1407.      configure GCC. Configuration of GNU CC is treated in depth in
  1408.      Chapter 4 of "Using and Porting GNU CC" Usually,
  1409.  
  1410.           % ../gcc/configure --prefix=/usr
  1411.  
  1412.      will do the job. This creates all the necessary config files,
  1413.      links and Makefile in the GCC object directory.
  1414.  
  1415.   3. The standard directory for installing GNU CC and GNU Pascal is
  1416.      `/usr/local/lib'. If you want to install its files somewhere else,
  1417.      specify `--prefix=DIR' when you run `configure'.  Here DIR is a
  1418.      directory name to use instead of `/usr/local' for all purposes
  1419.      with one exception: the directory `/usr/local/include' is searched
  1420.      for header files no matter where you install the compiler.  To
  1421.      override this name, use the `--local-prefix' option below.
  1422.  
  1423.   4. Specify `--local-prefix=DIR' if you want the compiler to search
  1424.      directory `DIR/include' for locally installed header files
  1425.      *instead* of `/usr/local/include'.
  1426.  
  1427.      You should specify `--local-prefix' *only* if your site has a
  1428.      different convention (not `/usr/local') for where to put
  1429.      site-specific files.
  1430.  
  1431.      *Do not* specify `/usr' as the `--local-prefix'!  The directory
  1432.      you use for `--local-prefix' *must not* contain any of the
  1433.      system's standard header files.  If it did contain them, certain
  1434.      programs would be miscompiled (including GNU Emacs, on certain
  1435.      targets), because this would override and nullify the header file
  1436.      corrections made by the `fixincludes' script.
  1437.  
  1438.   5. Make sure the Bison parser generator is installed.  (This is
  1439.      unnecessary if the Bison output files `c-parse.c' and `cexp.c' are
  1440.      more recent than `c-parse.y' and `cexp.y' and you do not plan to
  1441.      change the `.y' files.)
  1442.  
  1443.      Bison versions older than Sept 8, 1988 will produce incorrect
  1444.      output for `c-parse.c'.
  1445.  
  1446.   6. If you have chosen a configuration for GNU Pascal which requires
  1447.      other GNU tools (such as GAS or the GNU linker) instead of the
  1448.      standard system tools, install the required tools in the build
  1449.      directory under the names `as', `ld' or whatever is appropriate.
  1450.      This will enable the compiler to find the proper tools for
  1451.      compilation of the program `enquire'.
  1452.  
  1453.      Alternatively, you can do subsequent compilation using a value of
  1454.      the `PATH' environment variable such that the necessary GNU tools
  1455.      come before the standard system tools.
  1456.  
  1457.   7. Build the C compiler:
  1458.  
  1459.           % make LANGUAGES=c
  1460.  
  1461.      (Just `make' would also build the C++ and Objective C compilers).
  1462.      You do not need to install the compiler you just built, but leave
  1463.      the objects in place, since GPC will directly load most of the GCC
  1464.      object files.
  1465.  
  1466.   8. Configure GNU Pascal for your system.  Normally, you just `cd' to
  1467.      the directory containing the source code and type `./configure'.
  1468.      If you're using `csh' on an old version of System V, you might
  1469.      need to type `sh configure' instead to prevent `csh' from trying
  1470.      to execute `configure' itself (under AIX, you may need to use ksh
  1471.      instead of sh).
  1472.  
  1473.      To compile the GNU Pascal in a different directory from the one
  1474.      containing the source code, `cd' to the directory where you want
  1475.      the object files and executables to go and run the `configure'
  1476.      script.  `configure' automatically checks for the source code in
  1477.      the directory that `configure' is in. If for some reason
  1478.      `configure' is not able to find the source directory, rerun
  1479.      `configure' with the option `--srcdir=DIR', where DIR is the
  1480.      directory that contains the source code.
  1481.  
  1482.      Note that the gpc `configure' script does not accept most of the
  1483.      switches usually given to a `configure' script because is gets
  1484.      this information from the GCC configuration files.
  1485.  
  1486.      Running `configure' takes a while.  While it is running, it prints
  1487.      some messages that tell what it is doing.  If you don't want to
  1488.      see any messages, run `configure' with its standard output
  1489.      redirected to /dev/null; for example, `./configure >/dev/null'.
  1490.  
  1491.      If `configure' is unable to locate GNU CC sources or object code,
  1492.      it will print an error message and exit. In that case, run
  1493.      `configure' again with `--with-gccsrc=DIR' and / or
  1494.      `--with-gccbin=DIR' arguments.
  1495.  
  1496.      When it is finished, `configure' prints a short summary of the
  1497.      information it has collected.
  1498.  
  1499.           Configuration summary:
  1500.             GCC version:          2.7.2
  1501.             GCC sources in:       ../gcc-2.7.2
  1502.             GCC object code in:   ../gcc-i486-linux
  1503.             GPC sources in:       .
  1504.             Installation path:    /usr/bin, /usr/lib/gcc-lib/i486-linux/2.7.2
  1505.             Compiler:             gcc
  1506.             Compiler flags:       -g -O
  1507.             RTS compiler:         gcc
  1508.           
  1509.           Now, type "make" to build the compiler and runtime system.
  1510.  
  1511.   9. Building the compiler.  Once you are satisfied with the
  1512.      configuration as determined by `configure', you can build the
  1513.      compiler:
  1514.  
  1515.           make
  1516.  
  1517.      Optionally, you may supply CFLAGS, LDFLAGS or RTSFLAGS. CFLAGS is
  1518.      used for compiler and RTS, RTSFLAGS are   for RTS only, i.e.:
  1519.      'make CFLAGS="-m486 -O2" RTSFLAGS=-Wall'
  1520.  
  1521.  10. When everything compiles, you can verify what the  `make -n
  1522.      install' command does, and if you are satisfied run it without the
  1523.      `-n' option to install the compiler (gpc1), front end (gpc), run
  1524.      time system (libgpc.a) to the same place where gcc was installed.
  1525.  
  1526.      It is sort of stupid to have a separate incarnation of `gcc.c'; the
  1527.      difference now is that "gpc" also searches from library `libgpc.a'
  1528.      and `-lm'. In addition `gcc.c' specifies the interface to the
  1529.      Pascal compiler (gpc1). This command will vanish when "gcc" knows
  1530.      how to compile Pascal programs.
  1531.  
  1532.  
  1533.    Configuration dependent notes:
  1534.  
  1535. * Menu:
  1536.  
  1537. * System V::        Installation on System V comptaible unices (e.g. Linux)
  1538. * Alpha OSF/1::     Installation on an Alpha OSF/1 system
  1539.  
  1540. 
  1541. File: ^.!gcc.docs.pascal.gpc,  Node: System V,  Next: Alpha OSF/1,  Up: UNIX
  1542.  
  1543. System V compatible unices (e.g. Linux)
  1544. ---------------------------------------
  1545.  
  1546.    Compiling the Runtime System (RTS) on a System V compatible unix
  1547. requires "-DSYSV" to be set in CFLAGS. `configure' recognizes a number
  1548. of System V compatible unices, but not all.
  1549.  
  1550.    If you see:
  1551.      ../srcdir/rts/rts-rt0.c: In function `_p_initialize':
  1552.      ../srcdir/rts/rts-rt0.c:286: `SIGEMT' undeclared (first use this function)
  1553.      ../srcdir/rts/rts-rt0.c:290: `SIGSYS' undeclared (first use this function)
  1554.    while building `libgpc.a', you have to add "-DSYSV" to your
  1555. MY_CFLAGS.
  1556.  
  1557.    Example:
  1558.      % make MY_CFLAGS=-DSYSV other-make-flags-you-want-to-use
  1559.  
  1560.    Please send a report, with the canonical name of the system to
  1561. `gpc@kampi.hut.fi'
  1562.  
  1563. 
  1564. File: ^.!gcc.docs.pascal.gpc,  Node: Alpha OSF/1,  Prev: System V,  Up: UNIX
  1565.  
  1566. Alpha OSF/1
  1567. -----------
  1568.  
  1569.    For alpha OSF/1 v3.2 (GCC 2.6.3): If your linker starts to output
  1570. error messages like:
  1571.  
  1572.      Warning: Linking some objects which contain exception information sections
  1573.          and some which do not. This may cause fatal runtime exception handling
  1574.          problems (last obj encountered without exceptions was <OBJ/LIB>)
  1575.  
  1576.    I do not know why these started to appear, but you can get rid of
  1577. these if you do as follows in the GPC object directory.
  1578.  
  1579.    You need to trigger the Makefile dependencies, e.g. by doing the
  1580. touch command below. What happens is that it re-generates the version.c
  1581. and rts/version.c files, which need to be recompiled with `ALPHA_BUG'
  1582. defined.
  1583.  
  1584.    Example:
  1585.      % touch Makefile
  1586.      % make MY_CFLAGS=-DALPHA_BUG other-make-flags-you-want-to-use
  1587.  
  1588. 
  1589. File: ^.!gcc.docs.pascal.gpc,  Node: DJGPP,  Next: EMX,  Prev: UNIX,  Up: Installation
  1590.  
  1591. GNU Pascal for MS-DOS with DJGPP
  1592. ================================
  1593.  
  1594.    You cannot build GNU CC (or GNU Pascal) by itself on MS-DOS; it will
  1595. not compile under any MS-DOS compiler except itself. The official
  1596. MS-DOS port of GCC is called djgpp, and it is available from
  1597. `simtel.coast.net' and it's mirrors all over the world. The `configure'
  1598. script is replaced by an MS-DOS batch file called `configure.bat' wich
  1599. does essentially the same. A pre-configured source distribution should
  1600. be available from the same site where you got djgpp.
  1601.  
  1602. 
  1603. File: ^.!gcc.docs.pascal.gpc,  Node: EMX,  Next: Win32,  Prev: DJGPP,  Up: Installation
  1604.  
  1605. GNU Pascal for MS-DOS or OS/2 with EMX
  1606. ======================================
  1607.  
  1608.    EMX is a FreeWare 32-bit DOS extender which adds some properties of
  1609. UNIX to the DOS and OS/2 operating systems written by Eberhard Mattes.
  1610. You can find it, for example, via anonymous `ftp' on the server
  1611. `ftp.uni-stuttgart.de' in the directory `pub/systems/os2/emx*'.
  1612.  
  1613.    The EMX extender for DOS and OS/2 makes it relatively easy to port
  1614. GNU tools--such as the GNU Pascal Compiler--to these platforms.
  1615. However, it is not straightforward to compile it.  There is no bash.
  1616. No symbolic links.  8.3 file names.  Etc.  It took me about two
  1617. complete days to find out what to do--not much when facing the about 15
  1618. MegaBytes of sources, but enough.  The method I finally did it through
  1619. might be not the best one but it works, and I document it here.  If
  1620. somebody finds a cleaner way how to compile GNU Pascal for EMX, please
  1621. let me know!  `<peter.gerwinski@uni-essen.de>'.
  1622.  
  1623.   0. I assume you have the EMX package installed with GNU development
  1624.      tools and the `nmake' make utility.
  1625.  
  1626.      If you are using a DOS system, you are in trouble now, because the
  1627.      required utility `nmake' is an OS/2 program.  I was not able to
  1628.      replace it with, for example, Borland `make'; if you are, please
  1629.      inform me.
  1630.  
  1631.   1. Get the patched source code GCCSRC1.ZIP, GCCSRC2.ZIP, GCCSRC3.ZIP
  1632.      for GCC version 2.7.2.  (The correct version is important.)  Get
  1633.      the original source ZIP archive for GNU Pascal (GPC) 2.7.2 from
  1634.      `kampi.hut.fi'.
  1635.  
  1636.   2. Unzip the source for GCC.  E.g. with PKUNZIP, when the ZIP files
  1637.      are in the `C:\' directory:
  1638.  
  1639.             pkunzip -d c:\gccsrc? \
  1640.  
  1641.   3. Unzip the source for GPC in the `emx\gnu' directory.
  1642.  
  1643.             cd \emx\gnu
  1644.             pkunzip -d c:\gpc-272
  1645.  
  1646.   4. Rename the GCC subdirectory in `\emx\gnu' to make things more
  1647.      symmetric. (-: Don't omit this because the Makefile I created
  1648.      relies on this naming.)
  1649.  
  1650.             rendir gcc-2.7 gcc-272
  1651.  
  1652.      (with OS/2: `ren')
  1653.  
  1654.   5. Cd to the EMX subdirectory and run the nmake utility telling it
  1655.      whether you are using a FAT or a HPFS partition.  Use UPPERCASE
  1656.      here--nmake is case-sensitive.
  1657.  
  1658.             cd gpc-272\emx
  1659.             nmake FS=FAT
  1660.  
  1661.      Be patient - this will take a while to complete.
  1662.  
  1663.   6. That's it.  Hope that not too much went wrong.  Write some tiny
  1664.      test programs.  Write useful larger programs with GPC ...
  1665.  
  1666. 
  1667. File: ^.!gcc.docs.pascal.gpc,  Node: Win32,  Next: Cross-Compiler,  Prev: EMX,  Up: Installation
  1668.  
  1669. GNU Pascal for Windows NT and Windows 95 with CygWin32
  1670. ======================================================
  1671.  
  1672.    CygWin32 is a project to make it easy to port Unix applications to
  1673. machines which run an OS which supports the Win32 API - ie Windows 95
  1674. and Windows NT.  Windows NT runs on more than just the 386 too.
  1675. Currently, cygwin32 is in beta stage; it is available from
  1676. `ftp://ftp.cygnus.com/pub/gnu-win32/' This (beta) GCC is incompatible
  1677. with GNU Pascal, but neither gcc-2.6.3 nor gcc-2.7.2 does support the
  1678. cygwin32 platform. To patch cygwin32 support into a regular GNU CC
  1679. distribution, you need a special patch, available from the site where
  1680. you got the GNU Pascal sources. Because of the unix-ish environment
  1681. provided by cygwin32, configuring and building GNU Pascal is
  1682. essentially the same as a unix configuration.
  1683.  
  1684.    Currently, GNU Pascal does not support the stack calling convention
  1685. of the Win32 API, thus making it impossible to access system DLL's.
  1686.  
  1687. 
  1688. File: ^.!gcc.docs.pascal.gpc,  Node: Cross-Compiler,  Prev: Win32,  Up: Installation
  1689.  
  1690. Building and Installing a Cross-Compiler
  1691. ========================================
  1692.  
  1693.    GNU Pascal can function as a cross-compiler for many machines, but
  1694. not all.  Also, only a few combinations have been tested. If you need
  1695. information about GNU tools in a cross-configuration,
  1696. `ftp://ftp.cygnus.com/pub/embedded/crossgcc/' is the place to be.
  1697.  
  1698.    * Cross-compilers for the Mips as target using the Mips assembler
  1699.      currently do not work, because the auxiliary programs
  1700.      `mips-tdump.c' and `mips-tfile.c' can't be compiled on anything
  1701.      but a Mips.  It does work to cross compile for a Mips if you use
  1702.      the GNU assembler and linker.
  1703.  
  1704.    * Cross-compilers between machines with different floating point
  1705.      formats have not all been made to work.  GNU C now has a floating
  1706.      point emulator with which these can work, but each target machine
  1707.      description needs to be updated to take advantage of it.
  1708.  
  1709.    * Cross-compilation between machines of different word sizes is
  1710.      somewhat problematic and sometimes does not work.
  1711.  
  1712.    Since GNU Pascal generates assembler code, you probably need a
  1713. cross-assembler that GNU Pascal can run, in order to produce object
  1714. files.  If you want to link on other than the target machine, you need a
  1715. cross-linker as well.  You also need header files and libraries suitable
  1716. for the target machine that you can install on the host machine.
  1717.  
  1718. * Menu:
  1719.  
  1720. * Steps of Cross::      Using a cross-compiler involves several steps
  1721.                         that may be carried out on different machines.
  1722. * Configure Cross::     Configuring a cross-compiler.
  1723. * Build Cross::         Actually building a Pascal cross-compiler.
  1724.  
  1725. 
  1726. File: ^.!gcc.docs.pascal.gpc,  Node: Steps of Cross,  Next: Configure Cross,  Up: Cross-Compiler
  1727.  
  1728. Steps of Cross-Compilation
  1729. --------------------------
  1730.  
  1731.    To compile and run a program using a cross-compiler involves several
  1732. steps:
  1733.  
  1734.    * Run the cross-compiler on the host machine to produce assembler
  1735.      files for the target machine.  This requires header files for the
  1736.      target machine.
  1737.  
  1738.    * Assemble the files produced by the cross-compiler.  You can do this
  1739.      either with an assembler on the target machine, or with a
  1740.      cross-assembler on the host machine.
  1741.  
  1742.    * Link those files to make an executable.  You can do this either
  1743.      with a linker on the target machine, or with a cross-linker on the
  1744.      host machine.  Whichever machine you use, you need libraries and
  1745.      certain startup files (typically `crt....o') for the target
  1746.      machine.
  1747.  
  1748.    It is most convenient to do all of these steps on the same host
  1749. machine, since then you can do it all with a single invocation of GNU
  1750. Pascal.  This requires a suitable cross-assembler and cross-linker.
  1751. For some targets, the GNU assembler and linker are available.
  1752.  
  1753. 
  1754. File: ^.!gcc.docs.pascal.gpc,  Node: Configure Cross,  Next: Build Cross,  Prev: Steps of Cross,  Up: Cross-Compiler
  1755.  
  1756. Configuring GNU CC as a Cross-Compiler
  1757. --------------------------------------
  1758.  
  1759.    No special actions have to be taken to configure GNU Pascal as a
  1760. crosscompiler. Cross-compiler specific configuration is done only for
  1761. GCC.  Section 4.2 of "Using and Porting GNU CC" deals with
  1762. cross-configurations in great detail. Once cross-binutils and a C
  1763. library for the target machine are in place, GCC can be configured
  1764. (from the GCC object directory).  Suppose we are on a Linux system and
  1765. want a cross-compiler that produces code that runs on MS-DOS:
  1766.  
  1767.      % ../gcc/configure --prefix=/usr --target=i386-go32
  1768.  
  1769.    This creates all the necessary config files, links and Makefile in
  1770. the GCC object directory. Now, proceed with the compilation and
  1771. installation process like in the case of the native configuration
  1772. described before. Do not remove files from the GCC object directory;
  1773. the cross-compiler is used to compile the GNU Pascal runtime system
  1774. (RTS) for the target system.
  1775.  
  1776. 
  1777. File: ^.!gcc.docs.pascal.gpc,  Node: Build Cross,  Prev: Configure Cross,  Up: Cross-Compiler
  1778.  
  1779. Building the Pascal Cross-Compiler
  1780. ----------------------------------
  1781.  
  1782.    Once you have verified the C cross-compiler, the Pascal
  1783. cross-compiler can be configured and built. Note that the `configure'
  1784. script does not require any cross-compiler related switches because GPC
  1785. inherits all of this from GNU CC.  Assuming GCC object code is in
  1786. `../gcc-i386-go32/',
  1787.  
  1788.      % ../gpc/configure --srcdir=../gpc --gccdir=../gcc-i386-go32 --gccsrc=../gcc
  1789.      % make
  1790.  
  1791.    Then, "make install" the cross-compiler.
  1792.  
  1793. 
  1794. File: ^.!gcc.docs.pascal.gpc,  Node: Invoking GPC,  Next: Keywords,  Prev: Installation,  Up: Top
  1795.  
  1796. GNU Pascal Command Options
  1797. **************************
  1798.  
  1799.    When you invoke GPC, it normally does preprocessing, compilation,
  1800. assembly and linking.  The "overall options" allow you to stop this
  1801. process at an intermediate stage.  For example, the `-c' option says
  1802. not to run the linker.  Then the output consists of object files output
  1803. by the assembler.
  1804.  
  1805.    Other options are passed on to one stage of processing.  Some options
  1806. control the preprocessor and others the compiler itself.  Yet other
  1807. options control the assembler and linker; most of these are not
  1808. documented here, since you rarely need to use any of them.
  1809.  
  1810.    The `gpc' program accepts options and file names as operands.  Many
  1811. options have multiletter names; therefore multiple single-letter options
  1812. may *not* be grouped: `-dr' is very different from `-d -r'.
  1813.  
  1814.    You can mix options and other arguments.  For the most part, the
  1815. order you use doesn't matter.  Order does matter when you use several
  1816. options of the same kind; for example, if you specify `-L' more than
  1817. once, the directories are searched in the order specified.
  1818.  
  1819.    Many options have long names starting with `-f' or with `-W'--for
  1820. example, `-fforce-mem', `-fstrength-reduce', `-Wformat' and so on.
  1821. Most of these have both positive and negative forms; the negative form
  1822. of `-ffoo' would be `-fno-foo'.  This manual documents only one of
  1823. these two forms, whichever one is not the default.
  1824.  
  1825. * Menu:
  1826.  
  1827. * Option Summary::          Brief list of all options, without explanations.
  1828. * Overall Options::        Controlling the kind of output:
  1829.                            an executable, object files, assembler files,
  1830.                            or preprocessed source.
  1831. * Pascal Dialect Options:: Controlling the variant of Pascal language compiled.
  1832. * Code Gen Options::       Specifying conventions for function calls, data
  1833.                            layout and register usage.
  1834. * Warning Options::        How picky should the compiler be?
  1835. * Debugging Options::      Symbol tables, measurements, and debugging dumps.
  1836. * Optimize Options::       How much optimization?
  1837. * Preprocessor Options::   Controlling header files and macro definitions.
  1838.                            Also, getting dependency information for Make.
  1839. * Assembler Options::      Passing options to the assembler.
  1840. * Link Options::           Specifying libraries and so on.
  1841. * Directory Options::      Where to find header files and libraries.
  1842.                            Where to find the compiler executable files.
  1843. * Target Options::         Running a cross-compiler, or an old version
  1844.                            of GNU Pascal.
  1845. * Submodel Options::       Specifying minor hardware or convention variations,
  1846.                            such as 68010 vs 68020.
  1847. * Environment Variables::  Env vars that affect GNU Pascal.
  1848.  
  1849. 
  1850. File: ^.!gcc.docs.pascal.gpc,  Node: Option Summary,  Next: Overall Options,  Up: Invoking GPC
  1851.  
  1852. Option Summary
  1853. ==============
  1854.  
  1855.    Here is a summary of all the options, grouped by type.  Explanations
  1856. are in the following sections.
  1857.  
  1858. *Overall Options*
  1859.      *Note Options Controlling the Kind of Output: Overall Options.
  1860.           -c  --automake  -S  -E  -o FILE  -pipe  -v  -x LANGUAGE
  1861.  
  1862. *Pascal Language Options*
  1863.      *Note Options Controlling Pascal Dialect: Pascal Dialect Options.
  1864.           --nested-comments --char-escapes --c-numbers
  1865.           --standard-pascal --extended-pascal --object-pascal --borland-pascal
  1866.           --pascal-sc --extended-syntax
  1867.  
  1868. *Code Generation Options*
  1869.      *Note Options for Code Generation Conventions: Code Gen Options.
  1870.           --short-circuit --lazy-io --setlimit
  1871.           --call-saved-REG  --call-used-REG
  1872.           --fixed-REG  --inhibit-size-directive
  1873.           --no-common  --no-ident  --no-gnu-linker
  1874.           --pcc-struct-return  --pic  --PIC
  1875.           --reg-struct-return  --shared-data  --short-enums
  1876.           --short-double  --volatile  --volatile-global
  1877.           --verbose-asm --pack-struct
  1878.  
  1879. *Warning Options*
  1880.      *Note Options to Request or Suppress Warnings: Warning Options.
  1881.           --syntax-only  --pedantic  --pedantic-errors
  1882.           -w  -W  -Wall  -Waggregate-return  -Wbad-function-cast
  1883.           -Wcast-align -Wcast-qual  -Wchar-subscript  -Wcomment
  1884.           -Wconversion -Wenum-clash  -Werror  -Wformat
  1885.           -Wid-clash-LEN  -Wimplicit  -Wimport  -Winline
  1886.           -Wlarger-than-LEN  -Wmissing-declarations
  1887.           -Wmissing-prototypes  -Wnested-externs
  1888.           -Wno-import  -Woverloaded-virtual -Wparentheses
  1889.           -Wpointer-arith  -Wredundant-decls -Wreorder -Wreturn-type -Wshadow
  1890.           -Wstrict-prototypes  -Wswitch  -Wsynth  -Wtemplate-debugging
  1891.           -Wtraditional  -Wtrigraphs -Wuninitialized  -Wunused
  1892.           -Wwrite-strings
  1893.  
  1894. *Debugging Options*
  1895.      *Note Options for Debugging Your Program or GCC: Debugging Options.
  1896.           -a  -dLETTERS  -fpretend-float
  1897.           -g  -gLEVEL -gcoff  -gdwarf  -gdwarf+
  1898.           -ggdb  -gstabs  -gstabs+  -gxcoff  -gxcoff+
  1899.           -p  -pg  -print-file-name=LIBRARY  -print-libgcc-file-name
  1900.           -print-prog-name=PROGRAM  -print-search-dirs  -save-temps
  1901.           --lines  --debug-gpi
  1902.  
  1903. *Optimization Options*
  1904.      *Note Options that Control Optimization: Optimize Options.
  1905.           --caller-saves  --cse-follow-jumps  --cse-skip-blocks
  1906.           --delayed-branch   --expensive-optimizations
  1907.           --fast-math  --float-store  --force-addr  --force-mem
  1908.           --inline-functions  --keep-inline-functions
  1909.           --no-default-inline  --no-defer-pop  --no-function-cse
  1910.           --no-inline  --no-peephole  --omit-frame-pointer
  1911.           --rerun-cse-after-loop  --schedule-insns
  1912.           --schedule-insns2  --strength-reduce  --thread-jumps
  1913.           --unroll-all-loops  --unroll-loops
  1914.           -O  -O0  -O1  -O2  -O3
  1915.  
  1916. *Preprocessor Options*
  1917.      *Note Options Controlling the Preprocessor: Preprocessor Options.
  1918.           -AQUESTION(ANSWER)  -C  -dD  -dM  -dN
  1919.           -DMACRO[=DEFN]  -E  -H
  1920.           -idirafter DIR
  1921.           -include FILE  -imacros FILE
  1922.           -iprefix FILE  -iwithprefix DIR
  1923.           -iwithprefixbefore DIR  -isystem DIR
  1924.           -M  -MD  -MM  -MMD  -MG  -nostdinc  -P  -trigraphs
  1925.           -undef  -UMACRO  -Wp,OPTION
  1926.  
  1927. *Assembler Option*
  1928.      *Note Passing Options to the Assembler: Assembler Options.
  1929.           -Wa,OPTION
  1930.  
  1931. *Linker Options*
  1932.      *Note Options for Linking: Link Options.
  1933.           OBJECT-FILE-NAME  -lLIBRARY
  1934.           -nostartfiles  -nodefaultlibs  -nostdlib
  1935.           -s  -static  -shared  -symbolic
  1936.           -Wl,OPTION  -Xlinker OPTION
  1937.           -u SYMBOL
  1938.  
  1939. *Directory Options*
  1940.      *Note Options for Directory Search: Directory Options.
  1941.           -BPREFIX  -IDIR  -I-  -LDIR
  1942.  
  1943. *Target Options*
  1944.      *Note Target Options::.
  1945.           -b MACHINE  -V VERSION
  1946.  
  1947. *Machine Dependent Options*
  1948.      *Note Hardware Models and Configurations: Submodel Options.
  1949.           *M680x0 Options*
  1950.           -m68000  -m68020  -m68020-40  -m68030  -m68040  -m68881
  1951.           -mbitfield  -mc68000  -mc68020  -mfpa  -mnobitfield
  1952.           -mrtd  -mshort  -msoft-float
  1953.           
  1954.           *VAX Options*
  1955.           -mg  -mgnu  -munix
  1956.           
  1957.           *SPARC Options*
  1958.           -mapp-regs  -mcypress  -mepilogue  -mflat  -mfpu  -mhard-float
  1959.           -mhard-quad-float  -mno-app-regs  -mno-flat  -mno-fpu
  1960.           -mno-epilogue  -mno-unaligned-doubles
  1961.           -msoft-float  -msoft-quad-float
  1962.           -msparclite  -msupersparc  -munaligned-doubles  -mv8
  1963.           
  1964.           SPARC V9 compilers support the following options
  1965.           in addition to the above:
  1966.           
  1967.           -mmedlow  -mmedany
  1968.           -mint32  -mint64  -mlong32  -mlong64
  1969.           -mno-stack-bias  -mstack-bias
  1970.           
  1971.           *Convex Options*
  1972.           -mc1  -mc2  -mc32  -mc34  -mc38
  1973.           -margcount  -mnoargcount
  1974.           -mlong32  -mlong64
  1975.           -mvolatile-cache  -mvolatile-nocache
  1976.           
  1977.           *AMD29K Options*
  1978.           -m29000  -m29050  -mbw  -mnbw  -mdw  -mndw
  1979.           -mlarge  -mnormal  -msmall
  1980.           -mkernel-registers  -mno-reuse-arg-regs
  1981.           -mno-stack-check  -mno-storem-bug
  1982.           -mreuse-arg-regs  -msoft-float  -mstack-check
  1983.           -mstorem-bug  -muser-registers
  1984.           
  1985.           *ARM Options*
  1986.           -mapcs -m2 -m3 -m6 -mbsd -mxopen -mno-symrename
  1987.           
  1988.           *M88K Options*
  1989.           -m88000  -m88100  -m88110  -mbig-pic
  1990.           -mcheck-zero-division  -mhandle-large-shift
  1991.           -midentify-revision  -mno-check-zero-division
  1992.           -mno-ocs-debug-info  -mno-ocs-frame-position
  1993.           -mno-optimize-arg-area  -mno-serialize-volatile
  1994.           -mno-underscores  -mocs-debug-info
  1995.           -mocs-frame-position  -moptimize-arg-area
  1996.           -mserialize-volatile  -mshort-data-NUM  -msvr3
  1997.           -msvr4  -mtrap-large-shift  -muse-div-instruction
  1998.           -mversion-03.00  -mwarn-passed-structs
  1999.           
  2000.           *RS/6000 and PowerPC Options*
  2001.           -mcpu=CPU  TYPE
  2002.           -mpower  -mno-power  -mpower2  -mno-power2
  2003.           -mpowerpc  -mno-powerpc
  2004.           -mpowerpc-gpopt  -mno-powerpc-gpopt
  2005.           -mpowerpc-gfxopt  -mno-powerpc-gfxopt
  2006.           -mnew-mnemonics  -mno-new-mnemonics
  2007.           -mfull-toc   -mminimal-toc  -mno-fop-in-toc  -mno-sum-in-toc
  2008.           -msoft-float  -mhard-float -mmultiple -mno-multiple
  2009.           -mstring -mno-string -mbit-align -mno-bit-align
  2010.           -mstrict-align -mno-strict-align -mrelocatable -mno-relocatable
  2011.           -mtoc -mno-toc -mtraceback -mno-traceback
  2012.           -mlittle -mlittle-endian -mbig -mbig-endian
  2013.           -mcall-aix -mcall-sysv -mprototype
  2014.           
  2015.           *RT Options*
  2016.           -mcall-lib-mul  -mfp-arg-in-fpregs  -mfp-arg-in-gregs
  2017.           -mfull-fp-blocks  -mhc-struct-return  -min-line-mul
  2018.           -mminimum-fp-blocks  -mnohc-struct-return
  2019.           
  2020.           *MIPS Options*
  2021.           -mabicalls  -mcpu=CPU  TYPE  -membedded-data
  2022.           -membedded-pic  -mfp32  -mfp64  -mgas  -mgp32  -mgp64
  2023.           -mgpopt  -mhalf-pic  -mhard-float  -mint64 -mips1
  2024.           -mips2 -mips3  -mlong64  -mlong-calls  -mmemcpy
  2025.           -mmips-as  -mmips-tfile  -mno-abicalls
  2026.           -mno-embedded-data  -mno-embedded-pic
  2027.           -mno-gpopt  -mno-long-calls
  2028.           -mno-memcpy  -mno-mips-tfile  -mno-rnames  -mno-stats
  2029.           -mrnames -msoft-float
  2030.           -m4650 -msingle-float -mmad
  2031.           -mstats  -EL  -EB  -G NUM  -nocpp
  2032.           
  2033.           *i386 Options*
  2034.           -m486  -m386 -mieee-fp  -mno-fancy-math-387
  2035.           -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib
  2036.           -mno-wide-multiply -mrtd -malign-double
  2037.           -mreg-alloc=LIST -mregparm=NUM
  2038.           -malign-jumps=NUM -malign-loops=NUM
  2039.           -malign-functions=NUM
  2040.           
  2041.           *HPPA Options*
  2042.           -mdisable-fpregs  -mdisable-indexing  -mfast-indirect-calls
  2043.           -mgas  -mjump-in-delay -mlong-millicode-calls -mno-disable-fpregs
  2044.           -mno-disable-indexing -mno-fast-indirect-calls -mno-gas
  2045.           -mno-jump-in-delay -mno-millicode-long-calls
  2046.           -mno-portable-runtime -mno-soft-float -msoft-float
  2047.           -mpa-risc-1-0  -mpa-risc-1-1  -mportable-runtime -mschedule=LIST
  2048.           
  2049.           *Intel 960 Options*
  2050.           -mCPU TYPE  -masm-compat  -mclean-linkage
  2051.           -mcode-align  -mcomplex-addr  -mleaf-procedures
  2052.           -mic-compat  -mic2.0-compat  -mic3.0-compat
  2053.           -mintel-asm  -mno-clean-linkage  -mno-code-align
  2054.           -mno-complex-addr  -mno-leaf-procedures
  2055.           -mno-old-align  -mno-strict-align  -mno-tail-call
  2056.           -mnumerics  -mold-align  -msoft-float  -mstrict-align
  2057.           -mtail-call
  2058.           
  2059.           *DEC Alpha Options*
  2060.           -mfp-regs  -mno-fp-regs  -mno-soft-float
  2061.           -msoft-float
  2062.           
  2063.           *Clipper Options*
  2064.           -mc300 -mc400
  2065.           
  2066.           *H8/300 Options*
  2067.           -mrelax  -mh
  2068.           
  2069.           *System V Options*
  2070.           -Qy  -Qn  -YP,PATHS  -Ym,DIR
  2071.  
  2072. * Menu:
  2073.  
  2074. * Overall Options::        Controlling the kind of output:
  2075.                            an executable, object files, assembler files,
  2076.                            or preprocessed source.
  2077. * Pascal Dialect Options:: Controlling the variant of Pascal language compiled.
  2078. * Code Gen Options::       Specifying conventions for function calls, data
  2079.                            layout and register usage.
  2080. * Warning Options::        How picky should the compiler be?
  2081. * Debugging Options::      Symbol tables, measurements, and debugging dumps.
  2082. * Optimize Options::       How much optimization?
  2083. * Preprocessor Options::   Controlling header files and macro definitions.
  2084.                            Also, getting dependency information for Make.
  2085. * Assembler Options::      Passing options to the assembler.
  2086. * Link Options::           Specifying libraries and so on.
  2087. * Directory Options::      Where to find header files and libraries.
  2088.                            Where to find the compiler executable files.
  2089. * Target Options::         Running a cross-compiler, or an old version
  2090.                            of GNU Pascal.
  2091. * Submodel Options::       Specifying minor hardware or convention variations,
  2092.                            such as 68010 vs 68020.
  2093. * Environment Variables::  Env vars that affect GNU Pascal.
  2094.  
  2095. 
  2096. File: ^.!gcc.docs.pascal.gpc,  Node: Overall Options,  Next: Pascal Dialect Options,  Prev: Option Summary,  Up: Invoking GPC
  2097.  
  2098. Options Controlling the Kind of Output
  2099. ======================================
  2100.  
  2101.    Compilation can involve up to four stages: preprocessing, compilation
  2102. proper, assembly and linking, always in that order.  The first three
  2103. stages apply to an individual source file, and end by producing an
  2104. object file; linking combines all the object files (those newly
  2105. compiled, and those specified as input) into an executable file.
  2106.  
  2107.    For any given input file, the file name suffix determines what kind
  2108. of compilation is done:
  2109.  
  2110. `FILE.p'
  2111. `FILE.pas'
  2112.      Pascal source code which must be preprocessed.
  2113.  
  2114. `FILE.i'
  2115.      Pascal source code which should not be preprocessed.
  2116.  
  2117. `FILE.h'
  2118.      Pascal header file (not to be compiled or linked).
  2119.  
  2120. `FILE.s'
  2121.      Assembler code.
  2122.  
  2123. `FILE.S'
  2124.      Assembler code which must be preprocessed.
  2125.  
  2126. `OTHER'
  2127.      An object file to be fed straight into linking.  Any file name
  2128.      with no recognized suffix is treated this way.
  2129.  
  2130.    You can specify the input language explicitly with the `-x' option:
  2131.  
  2132. `-x LANGUAGE'
  2133.      Specify explicitly the LANGUAGE for the following input files
  2134.      (rather than letting the compiler choose a default based on the
  2135.      file name suffix).  This option applies to all following input
  2136.      files until the next `-x' option.  Possible values for LANGUAGE
  2137.      are:
  2138.           pascal c  objective-c  c++
  2139.           c-header  cpp-output  c++-cpp-output
  2140.           assembler  assembler-with-cpp
  2141.  
  2142. `-x none'
  2143.      Turn off any specification of a language, so that subsequent files
  2144.      are handled according to their file name suffixes (as they are if
  2145.      `-x' has not been used at all).
  2146.  
  2147.    If you only want some of the stages of compilation, you can use `-x'
  2148. (or filename suffixes) to tell `gcc' where to start, and one of the
  2149. options `-c', `-S', or `-E' to say where `gpc' is to stop.  Note that
  2150. some combinations (for example, `-x cpp-output -E' instruct `gpc' to do
  2151. nothing at all.
  2152.  
  2153. `-c'
  2154.      Compile or assemble the source files, but do not link.  The linking
  2155.      stage simply is not done.  The ultimate output is in the form of an
  2156.      object file for each source file.
  2157.  
  2158.      By default, the object file name for a source file is made by
  2159.      replacing the suffix `.p', `.pas', `.i', `.s', etc., with `.o'.
  2160.  
  2161.      Unrecognized input files, not requiring compilation or assembly,
  2162.      are ignored.
  2163.  
  2164. `--automake'
  2165.      Check whether Modules/Units used by the main program must be
  2166.      recompiled and do the recompilation.  For example, if the program
  2167.      `mainprog.pas' uses the Modules `module1.pas' and `module2.pas',
  2168.      the modules are automatically compiled if necessary when you
  2169.      specify
  2170.             gpc --automake mainprog.pas
  2171.  
  2172.      Options to be passed to "child" compilations must be given
  2173.      explicitely as a "String" argument to -automake, for example:
  2174.             gpc -O --automake="-O" mainprog.pas
  2175.  
  2176.      (For an explanation of the -O option, see *Note Optimize
  2177.      Options::.)
  2178.  
  2179.      *WARNING:* The AutoMake mechanism is a new feature in version 2.7.2
  2180.      and may be unstable.
  2181.  
  2182. `-S'
  2183.      Stop after the stage of compilation proper; do not assemble.  The
  2184.      output is in the form of an assembler code file for each
  2185.      non-assembler input file specified.
  2186.  
  2187.      By default, the assembler file name for a source file is made by
  2188.      replacing the suffix `.p', `.pas', `.i', etc., with `.s'.
  2189.  
  2190.      Input files that don't require compilation are ignored.
  2191.  
  2192. `-E'
  2193.      Stop after the preprocessing stage; do not run the compiler
  2194.      proper.  The output is in the form of preprocessed source code,
  2195.      which is sent to the standard output.
  2196.  
  2197.      Input files which don't require preprocessing are ignored.
  2198.  
  2199. `-o FILE'
  2200.      Place output in file FILE.  This applies regardless to whatever
  2201.      sort of output is being produced, whether it be an executable file,
  2202.      an object file, an assembler file or preprocessed C code.
  2203.  
  2204.      Since only one output file can be specified, it does not make
  2205.      sense to use `-o' when compiling more than one input file, unless
  2206.      you are producing an executable file as output.
  2207.  
  2208.      If `-o' is not specified, the default is to put an executable file
  2209.      in `a.out', the object file for `SOURCE.SUFFIX' in `SOURCE.o', its
  2210.      assembler file in `SOURCE.s', and all preprocessed C source on
  2211.      standard output.
  2212.  
  2213. `-v'
  2214.      Print (on standard error output) the commands executed to run the
  2215.      stages of compilation.  Also print the version number of the
  2216.      compiler driver program and of the preprocessor and the compiler
  2217.      proper.
  2218.  
  2219. `-pipe'
  2220.      Use pipes rather than temporary files for communication between the
  2221.      various stages of compilation.  This fails to work on some systems
  2222.      where the assembler is unable to read from a pipe; but the GNU
  2223.      assembler has no trouble.
  2224.  
  2225. 
  2226. File: ^.!gcc.docs.pascal.gpc,  Node: Pascal Dialect Options,  Next: Code Gen Options,  Prev: Overall Options,  Up: Invoking GPC
  2227.  
  2228. Options Controlling Pascal Dialect
  2229. ==================================
  2230.  
  2231.    In cases where the different Pascal dialects contradict, GNU Pascal
  2232. complies to the ISO standard by default.  However you can change this
  2233. behavior using command-line options or associated compiler switches.
  2234.  
  2235. `--nested-comments  (*$N+*)'
  2236.      Enable { nested comments (* like this one *) in your } Pascal
  2237.      source.  Without this option, comments may start with { and end
  2238.      with *).
  2239.  
  2240.      The compiler switch `$N' is equivalent to `--nested-comments' and
  2241.      allows local specifications.
  2242.  
  2243.      *A cross reference to compiler switches is in preparation.*
  2244.  
  2245. `--char-escapes  (*$E+*)'
  2246.      Enable C-style character escape sequences in strings.
  2247.  
  2248. `--c-numbers  (*$C+*)'
  2249.      Enable C-style octal and hexadecimal numbers: The decimal number
  2250.      255 is equal to the hexadecimal number `16#FF' (Extended Pascal
  2251.      notation) or `$FF' (Borland Pascal notation) or `0xFF' (C
  2252.      notation--works only with this switch active) or the octal number
  2253.      `0177' (C notation--ditto).
  2254.  
  2255. `--standard-pascal --extended-pascal --object-pascal --borland-pascal --pascal-sc'
  2256.      By default, GNU Pascal allows redefinition of keywords.  Each of
  2257.      this switches causes GNU Pascal to forbid the redefinition of
  2258.      keywords of the specified standard.
  2259.  
  2260.      Furthermore, `--borland-pascal' implies `--nested-comments' (see
  2261.      above), and `--pascal-sc' implies `--extended-syntax' (see below).
  2262.  
  2263. `--extended-syntax  (*$X+*)'
  2264.      Enables "dangerous" features of GNU Pascal such as
  2265.         * function return value ignore (works always, but gives warning
  2266.           without         -extended-syntax or $X+),
  2267.  
  2268.         * user-defined operators (Pascal-SC style),
  2269.  
  2270.         * *other extensions we are working on*.
  2271.  
  2272. 
  2273. File: ^.!gcc.docs.pascal.gpc,  Node: Code Gen Options,  Next: Warning Options,  Prev: Pascal Dialect Options,  Up: Invoking GPC
  2274.  
  2275. Options for Code Generation Conventions
  2276. =======================================
  2277.  
  2278.    These machine-independent options control the interface conventions
  2279. used in code generation.
  2280.  
  2281.    Most of them have both positive and negative forms; the negative form
  2282. of `-ffoo' would be `-fno-foo'.  In the table below, only one of the
  2283. forms is listed--the one which is not the default.  You can figure out
  2284. the other form by either removing `no-' or adding it.
  2285.  
  2286. `--short-circuit  (*$B-*)'
  2287.      Use short circuit evaluation of Boolean expressions.  By default,
  2288.      Boolean expressions are evaluated completely even if the result is
  2289.      kwown already.
  2290.  
  2291. `--lazy-io  (*$L+*)'
  2292.      Enable "lazy I/O", i.e. do a `put' as soon as you can and do `get'
  2293.      as late as you can.
  2294.  
  2295. `--setlimit:NUMBER'
  2296.      Define the maximum number of elements a set can hold to be NUMBER.
  2297.  
  2298. `--pcc-struct-return'
  2299.      Return "short" `Record' values in memory like longer ones, rather
  2300.      than in registers.  This convention is less efficient, but it has
  2301.      the advantage of allowing intercallability between GNU
  2302.      Pascal-compiled files and files compiled with other compilers.
  2303.  
  2304.      The precise convention for returning structures in memory depends
  2305.      on the target configuration macros.
  2306.  
  2307.      Short structures and unions are those whose size and alignment
  2308.      match that of some integer type.
  2309.  
  2310. `--reg-struct-return'
  2311.      Use the convention that `Record' values are returned in registers
  2312.      when possible.  This is more efficient for small structures than
  2313.      `--pcc-struct-return'.
  2314.  
  2315.      If you specify neither `--pcc-struct-return' nor its contrary
  2316.      `--reg-struct-return', GNU Pascal defaults to whichever convention
  2317.      is standard for the target.  If there is no standard convention,
  2318.      GNU Pascal defaults to `--pcc-struct-return', except on targets
  2319.      where GNU Pascal is the principal compiler.  In those cases, we
  2320.      can choose the standard, and we chose the more efficient register
  2321.      return alternative.
  2322.  
  2323. `--short-enums'
  2324.      Allocate to enumeral types only as many bytes as it needs for the
  2325.      declared range of possible values.
  2326.  
  2327. `--short-double'
  2328.      Use a smaller size for `Real'.
  2329.  
  2330. `--shared-data'
  2331.      Requests that the data and non-`const' variables of this
  2332.      compilation be shared data rather than private data.  The
  2333.      distinction makes sense only on certain operating systems, where
  2334.      shared data is shared between processes running the same program,
  2335.      while private data exists in one copy per process.
  2336.  
  2337. `--no-common'
  2338.      Allocate even uninitialized global variables in the bss section of
  2339.      the object file, rather than generating them as common blocks.
  2340.      This has the effect that if the same variable is declared (without
  2341.      `external') in two different compilations, you will get an error
  2342.      when you link them.  The only reason this might be useful is if
  2343.      you wish to verify that the program will work on other systems
  2344.      which always work this way.
  2345.  
  2346. `--no-ident'
  2347.      Ignore the `#ident' directive.
  2348.  
  2349. `--no-gnu-linker'
  2350.      Do not output global initializations (such as C++ constructors and
  2351.      destructors) in the form used by the GNU linker (on systems where
  2352.      the GNU linker is the standard method of handling them).  Use this
  2353.      option when you want to use a non-GNU linker, which also requires
  2354.      using the `collect2' program to make sure the system linker
  2355.      includes constructors and destructors.  (`collect2' is included in
  2356.      the GNU Pascal distribution.)  For systems which *must* use
  2357.      `collect2', the compiler driver `gpc' is configured to do this
  2358.      automatically.
  2359.  
  2360. `--inhibit-size-directive'
  2361.      Don't output a `.size' assembler directive, or anything else that
  2362.      would cause trouble if the function is split in the middle, and the
  2363.      two halves are placed at locations far apart in memory.  This
  2364.      option is used when compiling `crtstuff.c'; you should not need to
  2365.      use it for anything else.
  2366.  
  2367. `--verbose-asm'
  2368.      Put extra commentary information in the generated assembly code to
  2369.      make it more readable.  This option is generally only of use to
  2370.      those who actually need to read the generated assembly code
  2371.      (perhaps while debugging the compiler itself).
  2372.  
  2373. `--volatile'
  2374.      Consider all memory references through pointers to be volatile.
  2375.  
  2376. `--volatile-global'
  2377.      Consider all memory references to external and global data items to
  2378.      be volatile.
  2379.  
  2380. `--pic'
  2381.      Generate position-independent code (PIC) suitable for use in a
  2382.      shared library, if supported for the target machine.  Such code
  2383.      accesses all constant addresses through a global offset table
  2384.      (GOT).  If the GOT size for the linked executable exceeds a
  2385.      machine-specific maximum size, you get an error message from the
  2386.      linker indicating that `--pic' does not work; in that case,
  2387.      recompile with `--PIC' instead.  (These maximums are 16k on the
  2388.      m88k, 8k on the Sparc, and 32k on the m68k and RS/6000.  The 386
  2389.      has no such limit.)
  2390.  
  2391.      Position-independent code requires special support, and therefore
  2392.      works only on certain machines.  For the 386, GNU Pascal supports
  2393.      PIC for System V but not for the Sun 386i.  Code generated for the
  2394.      IBM RS/6000 is always position-independent.
  2395.  
  2396.      The GNU assembler does not fully support PIC.  Currently, you must
  2397.      use some other assembler in order for PIC to work.  We would
  2398.      welcome volunteers to upgrade GAS to handle this; the first part
  2399.      of the job is to figure out what the assembler must do differently.
  2400.  
  2401. `--PIC'
  2402.      If supported for the target machine, emit position-independent
  2403.      code, suitable for dynamic linking and avoiding any limit on the
  2404.      size of the global offset table.  This option makes a difference
  2405.      on the m68k, m88k and the Sparc.
  2406.  
  2407.      Position-independent code requires special support, and therefore
  2408.      works only on certain machines.
  2409.  
  2410. `--fixed-REG'
  2411.      Treat the register named REG as a fixed register; generated code
  2412.      should never refer to it (except perhaps as a stack pointer, frame
  2413.      pointer or in some other fixed role).
  2414.  
  2415.      REG must be the name of a register.  The register names accepted
  2416.      are machine-specific and are defined in the `REGISTER_NAMES' macro
  2417.      in the machine description macro file.
  2418.  
  2419.      This flag does not have a negative form, because it specifies a
  2420.      three-way choice.
  2421.  
  2422. `--call-used-REG'
  2423.      Treat the register named REG as an allocatable register that is
  2424.      clobbered by function calls.  It may be allocated for temporaries
  2425.      or variables that do not live across a call.  Functions compiled
  2426.      this way will not save and restore the register REG.
  2427.  
  2428.      Use of this flag for a register that has a fixed pervasive role in
  2429.      the machine's execution model, such as the stack pointer or frame
  2430.      pointer, will produce disastrous results.
  2431.  
  2432.      This flag does not have a negative form, because it specifies a
  2433.      three-way choice.
  2434.  
  2435. `--call-saved-REG'
  2436.      Treat the register named REG as an allocatable register saved by
  2437.      functions.  It may be allocated even for temporaries or variables
  2438.      that live across a call.  Functions compiled this way will save
  2439.      and restore the register REG if they use it.
  2440.  
  2441.      Use of this flag for a register that has a fixed pervasive role in
  2442.      the machine's execution model, such as the stack pointer or frame
  2443.      pointer, will produce disastrous results.
  2444.  
  2445.      A different sort of disaster will result from the use of this flag
  2446.      for a register in which function values may be returned.
  2447.  
  2448.      This flag does not have a negative form, because it specifies a
  2449.      three-way choice.
  2450.  
  2451. `--pack-struct'
  2452.      Pack all structure members together without holes.  Usually you
  2453.      would not want to use this option, since it makes the code
  2454.      suboptimal, and the offsets of structure members won't agree with
  2455.      system libraries.
  2456.  
  2457. 
  2458. File: ^.!gcc.docs.pascal.gpc,  Node: Warning Options,  Next: Debugging Options,  Prev: Code Gen Options,  Up: Invoking GPC
  2459.  
  2460. Options to Request or Suppress Warnings
  2461. =======================================
  2462.  
  2463.    Warnings are diagnostic messages that report constructions which are
  2464. not inherently erroneous but which are risky or suggest there may have
  2465. been an error.
  2466.  
  2467.    You can request many specific warnings with options beginning `-W',
  2468. for example `-Wimplicit' to request warnings on implicit declarations.
  2469. Each of these specific warning options also has a negative form
  2470. beginning `-Wno-' to turn off warnings; for example, `-Wno-implicit'.
  2471. This manual lists only one of the two forms, whichever is not the
  2472. default.
  2473.  
  2474.    These options control the amount and kinds of warnings produced by
  2475. GNU Pascal:
  2476.  
  2477.    *GPC note: theses are all in toplev.c, but not all of them apply.*
  2478.  
  2479. `-fsyntax-only'
  2480.      Check the code for syntax errors, but don't do anything beyond
  2481.      that.
  2482.  
  2483. `-pedantic'
  2484.      Issue all the warnings demanded by strict ANSI standard Pascal;
  2485.      reject all programs that use forbidden extensions.
  2486.  
  2487.      Valid ANSI standard Pascal programs should compile properly with
  2488.      or without this option (though a rare few will require `-ansi').
  2489.      However, without this option, certain GNU extensions and
  2490.      traditional Pascal features are supported as well.  With this
  2491.      option, they are rejected.
  2492.  
  2493.      `-pedantic' does not cause warning messages for use of the
  2494.      alternate keywords whose names begin and end with `__'.  Pedantic
  2495.      warnings are also disabled in the expression that follows
  2496.      `__extension__'.  However, only system header files should use
  2497.      these escape routes; application programs should avoid them.
  2498.  
  2499.      This option is not intended to be useful; it exists only to satisfy
  2500.      pedants who would otherwise claim that GNU CC fails to support the
  2501.      ANSI standard.
  2502.  
  2503.      Some users try to use `-pedantic' to check programs for strict ANSI
  2504.      C conformance.  They soon find that it does not do quite what they
  2505.      want: it finds some non-ANSI practices, but not all--only those
  2506.      for which ANSI C *requires* a diagnostic.
  2507.  
  2508.      A feature to report any failure to conform to ANSI C might be
  2509.      useful in some instances, but would require considerable
  2510.      additional work and would be quite different from `-pedantic'.  We
  2511.      recommend, rather, that users take advantage of the extensions of
  2512.      GNU C and disregard the limitations of other compilers.  Aside
  2513.      from certain supercomputers and obsolete small machines, there is
  2514.      less and less reason ever to use any other C compiler other than
  2515.      for bootstrapping GNU CC.
  2516.  
  2517. `-pedantic-errors'
  2518.      Like `-pedantic', except that errors are produced rather than
  2519.      warnings.
  2520.  
  2521. `-w'
  2522.      Inhibit all warning messages.
  2523.  
  2524. `-Wno-import'
  2525.      Inhibit warning messages about the use of `#import'.
  2526.  
  2527. `-Wchar-subscripts'
  2528.      Warn if an array subscript has type `char'.  This is a common cause
  2529.      of error, as programmers often forget that this type is signed on
  2530.      some machines.
  2531.  
  2532. `-Wcomment'
  2533.      Warn whenever a comment-start sequence `/*' appears in a comment.
  2534.  
  2535. `-Wformat'
  2536.      Check calls to `printf' and `scanf', etc., to make sure that the
  2537.      arguments supplied have types appropriate to the format string
  2538.      specified.
  2539.  
  2540. `-Wimplicit'
  2541.      Warn whenever a function or parameter is implicitly declared.
  2542.  
  2543. `-Wparentheses'
  2544.      Warn if parentheses are omitted in certain contexts, such as when
  2545.      there is an assignment in a context where a truth value is
  2546.      expected, or when operators are nested whose precedence people
  2547.      often get confused about.
  2548.  
  2549. `-Wreturn-type'
  2550.      Warn whenever a function is defined with a return-type that
  2551.      defaults to `int'.  Also warn about any `return' statement with no
  2552.      return-value in a function whose return-type is not `void'.
  2553.  
  2554. `-Wswitch'
  2555.      Warn whenever a `switch' statement has an index of enumeral type
  2556.      and lacks a `case' for one or more of the named codes of that
  2557.      enumeration.  (The presence of a `default' label prevents this
  2558.      warning.)  `case' labels outside the enumeration range also
  2559.      provoke warnings when this option is used.
  2560.  
  2561. `-Wtrigraphs'
  2562.      Warn if any trigraphs are encountered (assuming they are enabled).
  2563.  
  2564. `-Wunused'
  2565.      Warn whenever a variable is unused aside from its declaration,
  2566.      whenever a function is declared static but never defined, whenever
  2567.      a label is declared but not used, and whenever a statement
  2568.      computes a result that is explicitly not used.
  2569.  
  2570.      To suppress this warning for an expression, simply cast it to
  2571.      void.  For unused variables and parameters, use the `unused'
  2572.      attribute.
  2573.  
  2574. `-Wuninitialized'
  2575.      An automatic variable is used without first being initialized.
  2576.  
  2577.      These warnings are possible only in optimizing compilation,
  2578.      because they require data flow information that is computed only
  2579.      when optimizing.  If you don't specify `-O', you simply won't get
  2580.      these warnings.
  2581.  
  2582.      These warnings occur only for variables that are candidates for
  2583.      register allocation.  Therefore, they do not occur for a variable
  2584.      that is declared `volatile', or whose address is taken, or whose
  2585.      size is other than 1, 2, 4 or 8 bytes.  Also, they do not occur for
  2586.      structures, unions or arrays, even when they are in registers.
  2587.  
  2588.      Note that there may be no warning about a variable that is used
  2589.      only to compute a value that itself is never used, because such
  2590.      computations may be deleted by data flow analysis before the
  2591.      warnings are printed.
  2592.  
  2593.      These warnings are made optional because GNU CC is not smart
  2594.      enough to see all the reasons why the code might be correct
  2595.      despite appearing to have an error.  Here is one example of how
  2596.      this can happen:
  2597.  
  2598.           {
  2599.             int x;
  2600.             switch (y)
  2601.               {
  2602.               case 1: x = 1;
  2603.                 break;
  2604.               case 2: x = 4;
  2605.                 break;
  2606.               case 3: x = 5;
  2607.               }
  2608.             foo (x);
  2609.           }
  2610.  
  2611.      If the value of `y' is always 1, 2 or 3, then `x' is always
  2612.      initialized, but GNU CC doesn't know this.  Here is another common
  2613.      case:
  2614.  
  2615.           {
  2616.             int save_y;
  2617.             if (change_y) save_y = y, y = new_y;
  2618.             ...
  2619.             if (change_y) y = save_y;
  2620.           }
  2621.  
  2622.      This has no bug because `save_y' is used only if it is set.
  2623.  
  2624.      Some spurious warnings can be avoided if you declare all the
  2625.      functions you use that never return as `noreturn'.
  2626.  
  2627. `-Wall'
  2628.      All of the above `-W' options combined.  These are all the options
  2629.      which pertain to usage that we recommend avoiding and that we
  2630.      believe is easy to avoid, even in conjunction with macros.
  2631.  
  2632.    The remaining `-W...' options are not implied by `-Wall' because
  2633. they warn about constructions that we consider reasonable to use, on
  2634. occasion, in clean programs.
  2635.  
  2636. `-W'
  2637.      Print extra warning messages for these events:
  2638.  
  2639.         * A nonvolatile automatic variable might be changed by a call to
  2640.           `longjmp'.  These warnings as well are possible only in
  2641.           optimizing compilation.
  2642.  
  2643.           The compiler sees only the calls to `setjmp'.  It cannot know
  2644.           where `longjmp' will be called; in fact, a signal handler
  2645.           could call it at any point in the code.  As a result, you may
  2646.           get a warning even when there is in fact no problem because
  2647.           `longjmp' cannot in fact be called at the place which would
  2648.           cause a problem.
  2649.  
  2650.         * A function can return either with or without a value.
  2651.           (Falling off the end of the function body is considered
  2652.           returning without a value.)  For example, this function would
  2653.           evoke such a warning:
  2654.  
  2655.                foo (a)
  2656.                {
  2657.                  if (a > 0)
  2658.                    return a;
  2659.                }
  2660.  
  2661.         * An expression-statement or the left-hand side of a comma
  2662.           expression contains no side effects.  To suppress the
  2663.           warning, cast the unused expression to void.  For example, an
  2664.           expression such as `x[i,j]' will cause a warning, but
  2665.           `x[(void)i,j]' will not.
  2666.  
  2667.         * An unsigned value is compared against zero with `<' or `<='.
  2668.  
  2669.         * A comparison like `x<=y<=z' appears; this is equivalent to
  2670.           `(x<=y ? 1 : 0) <= z', which is a different interpretation
  2671.           from that of ordinary mathematical notation.
  2672.  
  2673.         * Storage-class specifiers like `static' are not the first
  2674.           things in a declaration.  According to the C Standard, this
  2675.           usage is obsolescent.
  2676.  
  2677.         * If `-Wall' or `-Wunused' is also specified, warn about unused
  2678.           arguments.
  2679.  
  2680.         * An aggregate has a partly bracketed initializer.  For
  2681.           example, the following code would evoke such a warning,
  2682.           because braces are missing around the initializer for `x.h':
  2683.  
  2684.                struct s { int f, g; };
  2685.                struct t { struct s h; int i; };
  2686.                struct t x = { 1, 2, 3 };
  2687.  
  2688. `-Wtraditional'
  2689.      Warn about certain constructs that behave differently in
  2690.      traditional and ANSI C.
  2691.  
  2692.         * Macro arguments occurring within string constants in the
  2693.           macro body.  These would substitute the argument in
  2694.           traditional C, but are part of the constant in ANSI C.
  2695.  
  2696.         * A function declared external in one block and then used after
  2697.           the end of the block.
  2698.  
  2699.         * A `switch' statement has an operand of type `long'.
  2700.  
  2701. `-Wshadow'
  2702.      Warn whenever a local variable shadows another local variable.
  2703.  
  2704. `-Wid-clash-LEN'
  2705.      Warn whenever two distinct identifiers match in the first LEN
  2706.      characters.  This may help you prepare a program that will compile
  2707.      with certain obsolete, brain-damaged compilers.
  2708.  
  2709. `-Wlarger-than-LEN'
  2710.      Warn whenever an object of larger than LEN bytes is defined.
  2711.  
  2712. `-Wpointer-arith'
  2713.      Warn about anything that depends on the "size of" a function type
  2714.      or of `void'.  GNU C assigns these types a size of 1, for
  2715.      convenience in calculations with `void *' pointers and pointers to
  2716.      functions.
  2717.  
  2718. `-Wbad-function-cast'
  2719.      Warn whenever a function call is cast to a non-matching type.  For
  2720.      example, warn if `int malloc()' is cast to `anything *'.
  2721.  
  2722. `-Wcast-qual'
  2723.      Warn whenever a pointer is cast so as to remove a type qualifier
  2724.      from the target type.  For example, warn if a `const char *' is
  2725.      cast to an ordinary `char *'.
  2726.  
  2727. `-Wcast-align'
  2728.      Warn whenever a pointer is cast such that the required alignment
  2729.      of the target is increased.  For example, warn if a `char *' is
  2730.      cast to an `int *' on machines where integers can only be accessed
  2731.      at two- or four-byte boundaries.
  2732.  
  2733. `-Wwrite-strings'
  2734.      Give string constants the type `const char[LENGTH]' so that
  2735.      copying the address of one into a non-`const' `char *' pointer
  2736.      will get a warning.  These warnings will help you find at compile
  2737.      time code that can try to write into a string constant, but only
  2738.      if you have been very careful about using `const' in declarations
  2739.      and prototypes.  Otherwise, it will just be a nuisance; this is
  2740.      why we did not make `-Wall' request these warnings.
  2741.  
  2742. `-Wconversion'
  2743.      Warn if a prototype causes a type conversion that is different
  2744.      from what would happen to the same argument in the absence of a
  2745.      prototype.  This includes conversions of fixed point to floating
  2746.      and vice versa, and conversions changing the width or signedness
  2747.      of a fixed point argument except when the same as the default
  2748.      promotion.
  2749.  
  2750.      Also, warn if a negative integer constant expression is implicitly
  2751.      converted to an unsigned type.  For example, warn about the
  2752.      assignment `x = -1' if `x' is unsigned.  But do not warn about
  2753.      explicit casts like `(unsigned) -1'.
  2754.  
  2755. `-Waggregate-return'
  2756.      Warn if any functions that return structures or unions are defined
  2757.      or called.  (In languages where you can return an array, this also
  2758.      elicits a warning.)
  2759.  
  2760. `-Wstrict-prototypes'
  2761.      Warn if a function is declared or defined without specifying the
  2762.      argument types.  (An old-style function definition is permitted
  2763.      without a warning if preceded by a declaration which specifies the
  2764.      argument types.)
  2765.  
  2766. `-Wmissing-prototypes'
  2767.      Warn if a global function is defined without a previous prototype
  2768.      declaration.  This warning is issued even if the definition itself
  2769.      provides a prototype.  The aim is to detect global functions that
  2770.      fail to be declared in header files.
  2771.  
  2772. `-Wmissing-declarations'
  2773.      Warn if a global function is defined without a previous
  2774.      declaration.  Do so even if the definition itself provides a
  2775.      prototype.  Use this option to detect global functions that are
  2776.      not declared in header files.
  2777.  
  2778. `-Wredundant-decls'
  2779.      Warn if anything is declared more than once in the same scope,
  2780.      even in cases where multiple declaration is valid and changes
  2781.      nothing.
  2782.  
  2783. `-Wnested-externs'
  2784.      Warn if an `extern' declaration is encountered within an function.
  2785.  
  2786. `-Winline'
  2787.      Warn if a function can not be inlined, and either it was declared
  2788.      as inline, or else the `-finline-functions' option was given.
  2789.  
  2790. `-Woverloaded-virtual'
  2791.      Warn when a derived class function declaration may be an error in
  2792.      defining a virtual function (C++ only).  In a derived class, the
  2793.      definitions of virtual functions must match the type signature of a
  2794.      virtual function declared in the base class.  With this option, the
  2795.      compiler warns when you define a function with the same name as a
  2796.      virtual function, but with a type signature that does not match any
  2797.      declarations from the base class.
  2798.  
  2799. `-Wsynth (C++ only)'
  2800.      Warn when g++'s synthesis behavior does not match that of cfront.
  2801.      For instance:
  2802.  
  2803.           struct A {
  2804.             operator int ();
  2805.             A& operator = (int);
  2806.           };
  2807.           
  2808.           main ()
  2809.           {
  2810.             A a,b;
  2811.             a = b;
  2812.           }
  2813.  
  2814.      In this example, g++ will synthesize a default `A& operator =
  2815.      (const A&);', while cfront will use the user-defined `operator ='.
  2816.  
  2817. `-Werror'
  2818.      Make all warnings into errors.
  2819.  
  2820. 
  2821. File: ^.!gcc.docs.pascal.gpc,  Node: Debugging Options,  Next: Optimize Options,  Prev: Warning Options,  Up: Invoking GPC
  2822.  
  2823. Options for Debugging Your Program or GNU Pascal
  2824. ================================================
  2825.  
  2826.    GNU Pascal has various special options that are used for debugging
  2827. either your program or GPC:
  2828.  
  2829. `-g'
  2830.      Produce debugging information in the operating system's native
  2831.      format (stabs, COFF, XCOFF, or DWARF).  GDB can work with this
  2832.      debugging information.
  2833.  
  2834.      On most systems that use stabs format, `-g' enables use of extra
  2835.      debugging information that only GDB can use; this extra information
  2836.      makes debugging work better in GDB but will probably make other
  2837.      debuggers crash or refuse to read the program.  If you want to
  2838.      control for certain whether to generate the extra information, use
  2839.      `-gstabs+', `-gstabs', `-gxcoff+', `-gxcoff', `-gdwarf+', or
  2840.      `-gdwarf' (see below).
  2841.  
  2842.      Unlike most other C compilers, GNU Pascal allows you to use `-g'
  2843.      with `-O'.  The shortcuts taken by optimized code may occasionally
  2844.      produce surprising results: some variables you declared may not
  2845.      exist at all; flow of control may briefly move where you did not
  2846.      expect it; some statements may not be executed because they
  2847.      compute constant results or their values were already at hand;
  2848.      some statements may execute in different places because they were
  2849.      moved out of loops.
  2850.  
  2851.      Nevertheless it proves possible to debug optimized output.  This
  2852.      makes it reasonable to use the optimizer for programs that might
  2853.      have bugs.
  2854.  
  2855.      The following options are useful when GNU Pascal is generated with
  2856.      the capability for more than one debugging format.
  2857.  
  2858. `-ggdb'
  2859.      Produce debugging information in the native format (if that is
  2860.      supported), including GDB extensions if at all possible.
  2861.  
  2862. `-gstabs'
  2863.      Produce debugging information in stabs format (if that is
  2864.      supported), without GDB extensions.  This is the format used by
  2865.      DBX on most BSD systems.  On MIPS, Alpha and System V Release 4
  2866.      systems this option produces stabs debugging output which is not
  2867.      understood by DBX or SDB.  On System V Release 4 systems this
  2868.      option requires the GNU assembler.
  2869.  
  2870. `-gstabs+'
  2871.      Produce debugging information in stabs format (if that is
  2872.      supported), using GNU extensions understood only by the GNU
  2873.      debugger (GDB).  The use of these extensions is likely to make
  2874.      other debuggers crash or refuse to read the program.
  2875.  
  2876. `-gcoff'
  2877.      Produce debugging information in COFF format (if that is
  2878.      supported).  This is the format used by SDB on most System V
  2879.      systems prior to System V Release 4.
  2880.  
  2881. `-gxcoff'
  2882.      Produce debugging information in XCOFF format (if that is
  2883.      supported).  This is the format used by the DBX debugger on IBM
  2884.      RS/6000 systems.
  2885.  
  2886. `-gxcoff+'
  2887.      Produce debugging information in XCOFF format (if that is
  2888.      supported), using GNU extensions understood only by the GNU
  2889.      debugger (GDB).  The use of these extensions is likely to make
  2890.      other debuggers crash or refuse to read the program, and may cause
  2891.      assemblers other than the GNU assembler (GAS) to fail with an
  2892.      error.
  2893.  
  2894. `-gdwarf'
  2895.      Produce debugging information in DWARF format (if that is
  2896.      supported).  This is the format used by SDB on most System V
  2897.      Release 4 systems.
  2898.  
  2899. `-gdwarf+'
  2900.      Produce debugging information in DWARF format (if that is
  2901.      supported), using GNU extensions understood only by the GNU
  2902.      debugger (GDB).  The use of these extensions is likely to make
  2903.      other debuggers crash or refuse to read the program.
  2904.  
  2905. `-gLEVEL'
  2906. `-ggdbLEVEL'
  2907. `-gstabsLEVEL'
  2908. `-gcoffLEVEL'
  2909. `-gxcoffLEVEL'
  2910. `-gdwarfLEVEL'
  2911.      Request debugging information and also use LEVEL to specify how
  2912.      much information.  The default level is 2.
  2913.  
  2914.      Level 1 produces minimal information, enough for making backtraces
  2915.      in parts of the program that you don't plan to debug.  This
  2916.      includes descriptions of functions and external variables, but no
  2917.      information about local variables and no line numbers.
  2918.  
  2919.      Level 3 includes extra information, such as all the macro
  2920.      definitions present in the program.  Some debuggers support macro
  2921.      expansion when you use `-g3'.
  2922.  
  2923. `-p'
  2924.      Generate extra code to write profile information suitable for the
  2925.      analysis program `prof'.  You must use this option when compiling
  2926.      the source files you want data about, and you must also use it when
  2927.      linking.
  2928.  
  2929. `-pg'
  2930.      Generate extra code to write profile information suitable for the
  2931.      analysis program `gprof'.  You must use this option when compiling
  2932.      the source files you want data about, and you must also use it when
  2933.      linking.
  2934.  
  2935. `-a'
  2936.      Generate extra code to write profile information for basic blocks,
  2937.      which will record the number of times each basic block is
  2938.      executed, the basic block start address, and the function name
  2939.      containing the basic block.  If `-g' is used, the line number and
  2940.      filename of the start of the basic block will also be recorded.
  2941.      If not overridden by the machine description, the default action is
  2942.      to append to the text file `bb.out'.
  2943.  
  2944.      This data could be analyzed by a program like `tcov'.  Note,
  2945.      however, that the format of the data is not what `tcov' expects.
  2946.      Eventually GNU `gprof' should be extended to process this data.
  2947.  
  2948. `-dLETTERS'
  2949.      Says to make debugging dumps during compilation at times specified
  2950.      by LETTERS.  This is used for debugging the compiler.  The file
  2951.      names for most of the dumps are made by appending a word to the
  2952.      source file name (e.g.  `foo.c.rtl' or `foo.c.jump').  Here are the
  2953.      possible letters for use in LETTERS, and their meanings:
  2954.  
  2955.     `M'
  2956.           Dump all macro definitions, at the end of preprocessing, and
  2957.           write no output.
  2958.  
  2959.     `N'
  2960.           Dump all macro names, at the end of preprocessing.
  2961.  
  2962.     `D'
  2963.           Dump all macro definitions, at the end of preprocessing, in
  2964.           addition to normal output.
  2965.  
  2966.     `y'
  2967.           Dump debugging information during parsing, to standard error.
  2968.  
  2969.     `r'
  2970.           Dump after RTL generation, to `FILE.rtl'.
  2971.  
  2972.     `x'
  2973.           Just generate RTL for a function instead of compiling it.
  2974.           Usually used with `r'.
  2975.  
  2976.     `j'
  2977.           Dump after first jump optimization, to `FILE.jump'.
  2978.  
  2979.     `s'
  2980.           Dump after CSE (including the jump optimization that sometimes
  2981.           follows CSE), to `FILE.cse'.
  2982.  
  2983.     `L'
  2984.           Dump after loop optimization, to `FILE.loop'.
  2985.  
  2986.     `t'
  2987.           Dump after the second CSE pass (including the jump
  2988.           optimization that sometimes follows CSE), to `FILE.cse2'.
  2989.  
  2990.     `f'
  2991.           Dump after flow analysis, to `FILE.flow'.
  2992.  
  2993.     `c'
  2994.           Dump after instruction combination, to the file
  2995.           `FILE.combine'.
  2996.  
  2997.     `S'
  2998.           Dump after the first instruction scheduling pass, to
  2999.           `FILE.sched'.
  3000.  
  3001.     `l'
  3002.           Dump after local register allocation, to `FILE.lreg'.
  3003.  
  3004.     `g'
  3005.           Dump after global register allocation, to `FILE.greg'.
  3006.  
  3007.     `R'
  3008.           Dump after the second instruction scheduling pass, to
  3009.           `FILE.sched2'.
  3010.  
  3011.     `J'
  3012.           Dump after last jump optimization, to `FILE.jump2'.
  3013.  
  3014.     `d'
  3015.           Dump after delayed branch scheduling, to `FILE.dbr'.
  3016.  
  3017.     `k'
  3018.           Dump after conversion from registers to stack, to
  3019.           `FILE.stack'.
  3020.  
  3021.     `a'
  3022.           Produce all the dumps listed above.
  3023.  
  3024.     `m'
  3025.           Print statistics on memory usage, at the end of the run, to
  3026.           standard error.
  3027.  
  3028.     `p'
  3029.           Annotate the assembler output with a comment indicating which
  3030.           pattern and alternative was used.
  3031.  
  3032. `-fpretend-float'
  3033.      When running a cross-compiler, pretend that the target machine
  3034.      uses the same floating point format as the host machine.  This
  3035.      causes incorrect output of the actual floating constants, but the
  3036.      actual instruction sequence will probably be the same as GNU
  3037.      Pascal would make when running on the target machine.
  3038.  
  3039. `-save-temps'
  3040.      Store the usual "temporary" intermediate files permanently; place
  3041.      them in the current directory and name them based on the source
  3042.      file.  Thus, compiling `foo.c' with `-c -save-temps' would produce
  3043.      files `foo.i' and `foo.s', as well as `foo.o'.
  3044.  
  3045. `-print-file-name=LIBRARY'
  3046.      Print the full absolute name of the library file LIBRARY that
  3047.      would be used when linking--and don't do anything else.  With this
  3048.      option, GNU Pascal does not compile or link anything; it just
  3049.      prints the file name.
  3050.  
  3051. `-print-prog-name=PROGRAM'
  3052.      Like `-print-file-name', but searches for a program such as `cpp'.
  3053.  
  3054. `-print-libgcc-file-name'
  3055.      Same as `-print-file-name=libgcc.a'.
  3056.  
  3057.      This is useful when you use `-nostdlib' or `-nodefaultlibs' but
  3058.      you do want to link with `libgcc.a'.  You can do
  3059.  
  3060.           gcc -nostdlib FILES... `gcc -print-libgcc-file-name`
  3061.  
  3062. `-print-search-dirs'
  3063.      Print the name of the configured installation directory and a list
  3064.      of program and library directories gcc will search--and don't do
  3065.      anything else.
  3066.  
  3067.      This is useful when gcc prints the error message `installation
  3068.      problem, cannot exec cpp: No such file or directory'.  To resolve
  3069.      this you either need to put `cpp' and the other compiler
  3070.      components where gcc expects to find them, or you can set the
  3071.      environment variable `GPC_EXEC_PREFIX' to the directory where you
  3072.      installed them.  Don't forget the trailing '/'.  *Note Environment
  3073.      Variables::.
  3074.  
  3075. 
  3076. File: ^.!gcc.docs.pascal.gpc,  Node: Optimize Options,  Next: Preprocessor Options,  Prev: Debugging Options,  Up: Invoking GPC
  3077.  
  3078. Options That Control Optimization
  3079. =================================
  3080.  
  3081.    These options control various sorts of optimizations:
  3082.  
  3083. `-O'
  3084. `-O1'
  3085.      Optimize.  Optimizing compilation takes somewhat more time, and a
  3086.      lot more memory for a large function.
  3087.  
  3088.      Without `-O', the compiler's goal is to reduce the cost of
  3089.      compilation and to make debugging produce the expected results.
  3090.      Statements are independent: if you stop the program with a
  3091.      breakpoint between statements, you can then assign a new value to
  3092.      any variable or change the program counter to any other statement
  3093.      in the function and get exactly the results you would expect from
  3094.      the source code.
  3095.  
  3096.      With `-O', the compiler tries to reduce code size and execution
  3097.      time.
  3098.  
  3099.      When you specify `-O', the compiler turns on `-fthread-jumps' and
  3100.      `-fdefer-pop' on all machines.  The compiler turns on
  3101.      `-fdelayed-branch' on machines that have delay slots, and
  3102.      `-fomit-frame-pointer' on machines that can support debugging even
  3103.      without a frame pointer.  On some machines the compiler also turns
  3104.      on other flags.
  3105.  
  3106. `-O2'
  3107.      Optimize even more.  GNU Pascal performs nearly all supported
  3108.      optimizations that do not involve a space-speed tradeoff.  The
  3109.      compiler does not perform loop unrolling or function inlining when
  3110.      you specify `-O2'.  As compared to `-O', this option increases
  3111.      both compilation time and the performance of the generated code.
  3112.  
  3113.      `-O2' turns on all optional optimizations except for loop unrolling
  3114.      and function inlining.  It also turns on the `-fforce-mem' option
  3115.      on all machines and frame pointer elimination on machines where
  3116.      doing so does not interfere with debugging.
  3117.  
  3118. `-O3'
  3119.      Optimize yet more.  `-O3' turns on all optimizations specified by
  3120.      `-O2' and also turns on the `inline-functions' option.
  3121.  
  3122. `-O0'
  3123.      Do not optimize.
  3124.  
  3125.      If you use multiple `-O' options, with or without level numbers,
  3126.      the last such option is the one that is effective.
  3127.  
  3128.    Options of the form `-fFLAG' specify machine-independent flags.
  3129. Most flags have both positive and negative forms; the negative form of
  3130. `-ffoo' would be `-fno-foo'.  In the table below, only one of the forms
  3131. is listed--the one which is not the default.  You can figure out the
  3132. other form by either removing `no-' or adding it.
  3133.  
  3134. `-ffloat-store'
  3135.      Do not store floating point variables in registers, and inhibit
  3136.      other options that might change whether a floating point value is
  3137.      taken from a register or memory.
  3138.  
  3139.      This option prevents undesirable excess precision on machines such
  3140.      as the 68000 where the floating registers (of the 68881) keep more
  3141.      precision than a `double' is supposed to have.  For most programs,
  3142.      the excess precision does only good, but a few programs rely on the
  3143.      precise definition of IEEE floating point.  Use `-ffloat-store' for
  3144.      such programs.
  3145.  
  3146. `-fno-default-inline'
  3147.      Do not make member functions inline by default merely because they
  3148.      are defined inside the class scope (C++ only).  Otherwise, when
  3149.      you specify `-O', member functions defined inside class scope are
  3150.      compiled inline by default; i.e., you don't need to add `inline'
  3151.      in front of the member function name.
  3152.  
  3153. `-fno-defer-pop'
  3154.      Always pop the arguments to each function call as soon as that
  3155.      function returns.  For machines which must pop arguments after a
  3156.      function call, the compiler normally lets arguments accumulate on
  3157.      the stack for several function calls and pops them all at once.
  3158.  
  3159. `-fforce-mem'
  3160.      Force memory operands to be copied into registers before doing
  3161.      arithmetic on them.  This produces better code by making all memory
  3162.      references potential common subexpressions.  When they are not
  3163.      common subexpressions, instruction combination should eliminate
  3164.      the separate register-load.  The `-O2' option turns on this option.
  3165.  
  3166. `-fforce-addr'
  3167.      Force memory address constants to be copied into registers before
  3168.      doing arithmetic on them.  This may produce better code just as
  3169.      `-fforce-mem' may.
  3170.  
  3171. `-fomit-frame-pointer'
  3172.      Don't keep the frame pointer in a register for functions that
  3173.      don't need one.  This avoids the instructions to save, set up and
  3174.      restore frame pointers; it also makes an extra register available
  3175.      in many functions.  *It also makes debugging impossible on some
  3176.      machines.*
  3177.  
  3178.      On some machines, such as the Vax, this flag has no effect, because
  3179.      the standard calling sequence automatically handles the frame
  3180.      pointer and nothing is saved by pretending it doesn't exist.  The
  3181.      machine-description macro `FRAME_POINTER_REQUIRED' controls
  3182.      whether a target machine supports this flag.  *Note Register
  3183.      Usage: (gcc.info)Registers.
  3184.  
  3185. `-fno-inline'
  3186.      Don't pay attention to the `inline' keyword.  Normally this option
  3187.      is used to keep the compiler from expanding any functions inline.
  3188.      Note that if you are not optimizing, no functions can be expanded
  3189.      inline.
  3190.  
  3191. `-finline-functions'
  3192.      Integrate all simple functions into their callers.  The compiler
  3193.      heuristically decides which functions are simple enough to be worth
  3194.      integrating in this way.
  3195.  
  3196.      If all calls to a given function are integrated, and the function
  3197.      is declared `static', then the function is normally not output as
  3198.      assembler code in its own right.
  3199.  
  3200. `-fkeep-inline-functions'
  3201.      Even if all calls to a given function are integrated, and the
  3202.      function is declared `static', nevertheless output a separate
  3203.      run-time callable version of the function.
  3204.  
  3205. `-fno-function-cse'
  3206.      Do not put function addresses in registers; make each instruction
  3207.      that calls a constant function contain the function's address
  3208.      explicitly.
  3209.  
  3210.      This option results in less efficient code, but some strange hacks
  3211.      that alter the assembler output may be confused by the
  3212.      optimizations performed when this option is not used.
  3213.  
  3214. `-ffast-math'
  3215.      This option allows GPC to violate some ANSI or IEEE rules and/or
  3216.      specifications in the interest of optimizing code for speed.  For
  3217.      example, it allows the compiler to assume arguments to the `sqrt'
  3218.      function are non-negative numbers and that no floating-point values
  3219.      are NaNs.
  3220.  
  3221.      This option should never be turned on by any `-O' option since it
  3222.      can result in incorrect output for programs which depend on an
  3223.      exact implementation of IEEE or ANSI rules/specifications for math
  3224.      functions.
  3225.  
  3226.    The following options control specific optimizations.  The `-O2'
  3227. option turns on all of these optimizations except `-funroll-loops' and
  3228. `-funroll-all-loops'.  On most machines, the `-O' option turns on the
  3229. `-fthread-jumps' and `-fdelayed-branch' options, but specific machines
  3230. may handle it differently.
  3231.  
  3232.    You can use the following flags in the rare cases when "fine-tuning"
  3233. of optimizations to be performed is desired.
  3234.  
  3235. `-fstrength-reduce'
  3236.      Perform the optimizations of loop strength reduction and
  3237.      elimination of iteration variables.
  3238.  
  3239. `-fthread-jumps'
  3240.      Perform optimizations where we check to see if a jump branches to a
  3241.      location where another comparison subsumed by the first is found.
  3242.      If so, the first branch is redirected to either the destination of
  3243.      the second branch or a point immediately following it, depending
  3244.      on whether the condition is known to be true or false.
  3245.  
  3246. `-fcse-follow-jumps'
  3247.      In common subexpression elimination, scan through jump instructions
  3248.      when the target of the jump is not reached by any other path.  For
  3249.      example, when CSE encounters an `if' statement with an `else'
  3250.      clause, CSE will follow the jump when the condition tested is
  3251.      false.
  3252.  
  3253. `-fcse-skip-blocks'
  3254.      This is similar to `-fcse-follow-jumps', but causes CSE to follow
  3255.      jumps which conditionally skip over blocks.  When CSE encounters a
  3256.      simple `if' statement with no else clause, `-fcse-skip-blocks'
  3257.      causes CSE to follow the jump around the body of the `if'.
  3258.  
  3259. `-frerun-cse-after-loop'
  3260.      Re-run common subexpression elimination after loop optimizations
  3261.      has been performed.
  3262.  
  3263. `-fexpensive-optimizations'
  3264.      Perform a number of minor optimizations that are relatively
  3265.      expensive.
  3266.  
  3267. `-fdelayed-branch'
  3268.      If supported for the target machine, attempt to reorder
  3269.      instructions to exploit instruction slots available after delayed
  3270.      branch instructions.
  3271.  
  3272. `-fschedule-insns'
  3273.      If supported for the target machine, attempt to reorder
  3274.      instructions to eliminate execution stalls due to required data
  3275.      being unavailable.  This helps machines that have slow floating
  3276.      point or memory load instructions by allowing other instructions
  3277.      to be issued until the result of the load or floating point
  3278.      instruction is required.
  3279.  
  3280. `-fschedule-insns2'
  3281.      Similar to `-fschedule-insns', but requests an additional pass of
  3282.      instruction scheduling after register allocation has been done.
  3283.      This is especially useful on machines with a relatively small
  3284.      number of registers and where memory load instructions take more
  3285.      than one cycle.
  3286.  
  3287. `-fcaller-saves'
  3288.      Enable values to be allocated in registers that will be clobbered
  3289.      by function calls, by emitting extra instructions to save and
  3290.      restore the registers around such calls.  Such allocation is done
  3291.      only when it seems to result in better code than would otherwise
  3292.      be produced.
  3293.  
  3294.      This option is enabled by default on certain machines, usually
  3295.      those which have no call-preserved registers to use instead.
  3296.  
  3297. `-funroll-loops'
  3298.      Perform the optimization of loop unrolling.  This is only done for
  3299.      loops whose number of iterations can be determined at compile time
  3300.      or run time.  `-funroll-loop' implies both `-fstrength-reduce' and
  3301.      `-frerun-cse-after-loop'.
  3302.  
  3303. `-funroll-all-loops'
  3304.      Perform the optimization of loop unrolling.  This is done for all
  3305.      loops and usually makes programs run more slowly.
  3306.      `-funroll-all-loops' implies `-fstrength-reduce' as well as
  3307.      `-frerun-cse-after-loop'.
  3308.  
  3309. `-fno-peephole'
  3310.      Disable any machine-specific peephole optimizations.
  3311.  
  3312. 
  3313. File: ^.!gcc.docs.pascal.gpc,  Node: Preprocessor Options,  Next: Assembler Options,  Prev: Optimize Options,  Up: Invoking GPC
  3314.  
  3315. Options Controlling the Preprocessor
  3316. ====================================
  3317.  
  3318.    *Does the Pascal Preprocessor bring new options?*
  3319.  
  3320.    These options control the Pascal preprocessor, which is run on each
  3321. Pascal source file before actual compilation.
  3322.  
  3323.    If you use the `-E' option, nothing is done except preprocessing.
  3324. Some of these options make sense only together with `-E' because they
  3325. cause the preprocessor output to be unsuitable for actual compilation.
  3326.  
  3327. `-include FILE'
  3328.      Process FILE as input before processing the regular input file.
  3329.      In effect, the contents of FILE are compiled first.  Any `-D' and
  3330.      `-U' options on the command line are always processed before
  3331.      `-include FILE', regardless of the order in which they are
  3332.      written.  All the `-include' and `-imacros' options are processed
  3333.      in the order in which they are written.
  3334.  
  3335. `-imacros FILE'
  3336.      Process FILE as input, discarding the resulting output, before
  3337.      processing the regular input file.  Because the output generated
  3338.      from FILE is discarded, the only effect of `-imacros FILE' is to
  3339.      make the macros defined in FILE available for use in the main
  3340.      input.
  3341.  
  3342.      Any `-D' and `-U' options on the command line are always processed
  3343.      before `-imacros FILE', regardless of the order in which they are
  3344.      written.  All the `-include' and `-imacros' options are processed
  3345.      in the order in which they are written.
  3346.  
  3347. `-idirafter DIR'
  3348.      Add the directory DIR to the second include path.  The directories
  3349.      on the second include path are searched when a header file is not
  3350.      found in any of the directories in the main include path (the one
  3351.      that `-I' adds to).
  3352.  
  3353. `-iprefix PREFIX'
  3354.      Specify PREFIX as the prefix for subsequent `-iwithprefix' options.
  3355.  
  3356. `-iwithprefix DIR'
  3357.      Add a directory to the second include path.  The directory's name
  3358.      is made by concatenating PREFIX and DIR, where PREFIX was
  3359.      specified previously with `-iprefix'.  If you have not specified a
  3360.      prefix yet, the directory containing the installed passes of the
  3361.      compiler is used as the default.
  3362.  
  3363. `-iwithprefixbefore DIR'
  3364.      Add a directory to the main include path.  The directory's name is
  3365.      made by concatenating PREFIX and DIR, as in the case of
  3366.      `-iwithprefix'.
  3367.  
  3368. `-isystem DIR'
  3369.      Add a directory to the beginning of the second include path,
  3370.      marking it as a system directory, so that it gets the same special
  3371.      treatment as is applied to the standard system directories.
  3372.  
  3373. `-nostdinc'
  3374.      Do not search the standard system directories for header files.
  3375.      Only the directories you have specified with `-I' options (and the
  3376.      current directory, if appropriate) are searched.  *Note Directory
  3377.      Options::, for information on `-I'.
  3378.  
  3379.      By using both `-nostdinc' and `-I-', you can limit the include-file
  3380.      search path to only those directories you specify explicitly.
  3381.  
  3382. `-undef'
  3383.      Do not predefine any nonstandard macros.  (Including architecture
  3384.      flags).
  3385.  
  3386. `-E'
  3387.      Run only the Pascal preprocessor.  Preprocess all the Pascal
  3388.      source files specified and output the results to standard output
  3389.      or to the specified output file.
  3390.  
  3391. `-C'
  3392.      Tell the preprocessor not to discard comments.  Used with the `-E'
  3393.      option.
  3394.  
  3395. `-P'
  3396.      Tell the preprocessor not to generate `#line' directives.  Used
  3397.      with the `-E' option.
  3398.  
  3399. `-M'
  3400.      Tell the preprocessor to output a rule suitable for `make'
  3401.      describing the dependencies of each object file.  For each source
  3402.      file, the preprocessor outputs one `make'-rule whose target is the
  3403.      object file name for that source file and whose dependencies are
  3404.      all the `$include' header files it uses.  This rule may be a
  3405.      single line or may be continued with `\'-newline if it is long.
  3406.      The list of rules is printed on standard output instead of the
  3407.      preprocessed Pascal program.
  3408.  
  3409.      `-M' implies `-E'.
  3410.  
  3411.      Another way to specify output of a `make' rule is by setting the
  3412.      environment variable `DEPENDENCIES_OUTPUT' (*note Environment
  3413.      Variables::.).
  3414.  
  3415. `-MM'
  3416.      Like `-M' but the output mentions only the user header files
  3417.      included with `#include "FILE"'.  System header files included
  3418.      with `#include <FILE>' are omitted.
  3419.  
  3420. `-MD'
  3421.      Like `-M' but the dependency information is written to a file made
  3422.      by replacing ".c" with ".d" at the end of the input file names.
  3423.      This is in addition to compiling the file as specified--`-MD' does
  3424.      not inhibit ordinary compilation the way `-M' does.
  3425.  
  3426.      In Mach, you can use the utility `md' to merge multiple dependency
  3427.      files into a single dependency file suitable for using with the
  3428.      `make' command.
  3429.  
  3430. `-MMD'
  3431.      Like `-MD' except mention only user header files, not system
  3432.      header files.
  3433.  
  3434. `-MG'
  3435.      Treat missing header files as generated files and assume they live
  3436.      in the same directory as the source file.  If you specify `-MG',
  3437.      you must also specify either `-M' or `-MM'.  `-MG' is not
  3438.      supported with `-MD' or `-MMD'.
  3439.  
  3440. `-H'
  3441.      Print the name of each header file used, in addition to other
  3442.      normal activities.
  3443.  
  3444. `-AQUESTION(ANSWER)'
  3445.      Assert the answer ANSWER for QUESTION, in case it is tested with a
  3446.      preprocessing conditional such as `#if #QUESTION(ANSWER)'.  `-A-'
  3447.      disables the standard assertions that normally describe the target
  3448.      machine.
  3449.  
  3450. `-DMACRO'
  3451.      Define macro MACRO with the string `1' as its definition.
  3452.  
  3453. `-DMACRO=DEFN'
  3454.      Define macro MACRO as DEFN.  All instances of `-D' on the command
  3455.      line are processed before any `-U' options.
  3456.  
  3457. `-UMACRO'
  3458.      Undefine macro MACRO.  `-U' options are evaluated after all `-D'
  3459.      options, but before any `-include' and `-imacros' options.
  3460.  
  3461. `-dM'
  3462.      Tell the preprocessor to output only a list of the macro
  3463.      definitions that are in effect at the end of preprocessing.  Used
  3464.      with the `-E' option.
  3465.  
  3466. `-dD'
  3467.      Tell the preprocessing to pass all macro definitions into the
  3468.      output, in their proper sequence in the rest of the output.
  3469.  
  3470. `-dN'
  3471.      Like `-dD' except that the macro arguments and contents are
  3472.      omitted.  Only `#define NAME' is included in the output.
  3473.  
  3474. `-trigraphs'
  3475.      Support ANSI C trigraphs.  The `-ansi' option also has this effect.
  3476.  
  3477. `-Wp,OPTION'
  3478.      Pass OPTION as an option to the preprocessor.  If OPTION contains
  3479.      commas, it is split into multiple options at the commas.
  3480.  
  3481. 
  3482. File: ^.!gcc.docs.pascal.gpc,  Node: Assembler Options,  Next: Link Options,  Prev: Preprocessor Options,  Up: Invoking GPC
  3483.  
  3484. Passing Options to the Assembler
  3485. ================================
  3486.  
  3487.    You can pass options to the assembler.
  3488.  
  3489. `-Wa,OPTION'
  3490.      Pass OPTION as an option to the assembler.  If OPTION contains
  3491.      commas, it is split into multiple options at the commas.
  3492.  
  3493. 
  3494. File: ^.!gcc.docs.pascal.gpc,  Node: Link Options,  Next: Directory Options,  Prev: Assembler Options,  Up: Invoking GPC
  3495.  
  3496. Options for Linking
  3497. ===================
  3498.  
  3499.    These options come into play when the compiler links object files
  3500. into an executable output file.  They are meaningless if the compiler is
  3501. not doing a link step.
  3502.  
  3503. `OBJECT-FILE-NAME'
  3504.      A file name that does not end in a special recognized suffix is
  3505.      considered to name an object file or library.  (Object files are
  3506.      distinguished from libraries by the linker according to the file
  3507.      contents.)  If linking is done, these object files are used as
  3508.      input to the linker.
  3509.  
  3510. `-c'
  3511. `-S'
  3512. `-E'
  3513.      If any of these options is used, then the linker is not run, and
  3514.      object file names should not be used as arguments.  *Note Overall
  3515.      Options::.
  3516.  
  3517. `-lLIBRARY'
  3518.      Search the library named LIBRARY when linking.
  3519.  
  3520.      It makes a difference where in the command you write this option;
  3521.      the linker searches processes libraries and object files in the
  3522.      order they are specified.  Thus, `foo.o -lz bar.o' searches
  3523.      library `z' after file `foo.o' but before `bar.o'.  If `bar.o'
  3524.      refers to functions in `z', those functions may not be loaded.
  3525.  
  3526.      The linker searches a standard list of directories for the library,
  3527.      which is actually a file named `libLIBRARY.a'.  The linker then
  3528.      uses this file as if it had been specified precisely by name.
  3529.  
  3530.      The directories searched include several standard system
  3531.      directories plus any that you specify with `-L'.
  3532.  
  3533.      Normally the files found this way are library files--archive files
  3534.      whose members are object files.  The linker handles an archive
  3535.      file by scanning through it for members which define symbols that
  3536.      have so far been referenced but not defined.  But if the file that
  3537.      is found is an ordinary object file, it is linked in the usual
  3538.      fashion.  The only difference between using an `-l' option and
  3539.      specifying a file name is that `-l' surrounds LIBRARY with `lib'
  3540.      and `.a' and searches several directories.
  3541.  
  3542. `-lobjc'
  3543.      You need this special case of the `-l' option in order to link an
  3544.      Objective C program.
  3545.  
  3546. `-nostartfiles'
  3547.      Do not use the standard system startup files when linking.  The
  3548.      standard system libraries are used normally, unless `-nostdlib' or
  3549.      `-nodefaultlibs' is used.
  3550.  
  3551. `-nodefaultlibs'
  3552.      Do not use the standard system libraries when linking.  Only the
  3553.      libraries you specify will be passed to the linker.  The standard
  3554.      startup files are used normally, unless `-nostartfiles' is used.
  3555.  
  3556. `-nostdlib'
  3557.      Do not use the standard system startup files or libraries when
  3558.      linking.  No startup files and only the libraries you specify will
  3559.      be passed to the linker.
  3560.  
  3561.      One of the standard libraries bypassed by `-nostdlib' and
  3562.      `-nodefaultlibs' is `libgcc.a', a library of internal subroutines
  3563.      that GNU Pascal uses to overcome shortcomings of particular
  3564.      machines, or special needs for some languages.  In most cases, you
  3565.      need `libgcc.a' even when you want to avoid other standard
  3566.      libraries.  In other words, when you specify `-nostdlib' or
  3567.      `-nodefaultlibs' you should usually specify `-lgcc' as well.  This
  3568.      ensures that you have no unresolved references to internal GNU
  3569.      Pascal library subroutines.  (For example, `__main', used to
  3570.      ensure C++ constructors will be called;
  3571.  
  3572. `-s'
  3573.      Remove all symbol table and relocation information from the
  3574.      executable.
  3575.  
  3576. `-static'
  3577.      On systems that support dynamic linking, this prevents linking
  3578.      with the shared libraries.  On other systems, this option has no
  3579.      effect.
  3580.  
  3581. `-shared'
  3582.      Produce a shared object which can then be linked with other
  3583.      objects to form an executable.  Only a few systems support this
  3584.      option.
  3585.  
  3586. `-symbolic'
  3587.      Bind references to global symbols when building a shared object.
  3588.      Warn about any unresolved references (unless overridden by the
  3589.      link editor option `-Xlinker -z -Xlinker defs').  Only a few
  3590.      systems support this option.
  3591.  
  3592. `-Xlinker OPTION'
  3593.      Pass OPTION as an option to the linker.  You can use this to
  3594.      supply system-specific linker options which GNU Pascal does not
  3595.      know how to recognize.
  3596.  
  3597.      If you want to pass an option that takes an argument, you must use
  3598.      `-Xlinker' twice, once for the option and once for the argument.
  3599.      For example, to pass `-assert definitions', you must write
  3600.      `-Xlinker -assert -Xlinker definitions'.  It does not work to write
  3601.      `-Xlinker "-assert definitions"', because this passes the entire
  3602.      string as a single argument, which is not what the linker expects.
  3603.  
  3604. `-Wl,OPTION'
  3605.      Pass OPTION as an option to the linker.  If OPTION contains
  3606.      commas, it is split into multiple options at the commas.
  3607.  
  3608. `-u SYMBOL'
  3609.      Pretend the symbol SYMBOL is undefined, to force linking of
  3610.      library modules to define it.  You can use `-u' multiple times with
  3611.      different symbols to force loading of additional library modules.
  3612.  
  3613. 
  3614. File: ^.!gcc.docs.pascal.gpc,  Node: Directory Options,  Next: Target Options,  Prev: Link Options,  Up: Invoking GPC
  3615.  
  3616. Options for Directory Search
  3617. ============================
  3618.  
  3619.    These options specify directories to search for header files, for
  3620. libraries and for parts of the compiler:
  3621.  
  3622. `-IDIR'
  3623.      Add the directory DIRECTORY to the head of the list of directories
  3624.      to be searched for header files.  This can be used to override a
  3625.      system header file, substituting your own version, since these
  3626.      directories are searched before the system header file
  3627.      directories.  If you use more than one `-I' option, the
  3628.      directories are scanned in left-to-right order; the standard
  3629.      system directories come after.
  3630.  
  3631. `-I-'
  3632.      Any directories you specify with `-I' options before the `-I-'
  3633.      option are searched only for the case of `#include "FILE"'; they
  3634.      are not searched for `#include <FILE>'.
  3635.  
  3636.      If additional directories are specified with `-I' options after
  3637.      the `-I-', these directories are searched for all `#include'
  3638.      directives.  (Ordinarily *all* `-I' directories are used this way.)
  3639.  
  3640.      In addition, the `-I-' option inhibits the use of the current
  3641.      directory (where the current input file came from) as the first
  3642.      search directory for `#include "FILE"'.  There is no way to
  3643.      override this effect of `-I-'.  With `-I.' you can specify
  3644.      searching the directory which was current when the compiler was
  3645.      invoked.  That is not exactly the same as what the preprocessor
  3646.      does by default, but it is often satisfactory.
  3647.  
  3648.      `-I-' does not inhibit the use of the standard system directories
  3649.      for header files.  Thus, `-I-' and `-nostdinc' are independent.
  3650.  
  3651. `-LDIR'
  3652.      Add directory DIR to the list of directories to be searched for
  3653.      `-l'.
  3654.  
  3655. `-BPREFIX'
  3656.      This option specifies where to find the executables, libraries,
  3657.      include files, and data files of the compiler itself.
  3658.  
  3659.      The compiler driver program runs one or more of the subprograms
  3660.      `cpp', `cc1', `as' and `ld'.  It tries PREFIX as a prefix for each
  3661.      program it tries to run, both with and without `MACHINE/VERSION/'
  3662.      (*note Target Options::.).
  3663.  
  3664.      For each subprogram to be run, the compiler driver first tries the
  3665.      `-B' prefix, if any.  If that name is not found, or if `-B' was
  3666.      not specified, the driver tries two standard prefixes, which are
  3667.      `/usr/lib/gcc/' and `/usr/local/lib/gcc-lib/'.  If neither of
  3668.      those results in a file name that is found, the unmodified program
  3669.      name is searched for using the directories specified in your
  3670.      `PATH' environment variable.
  3671.  
  3672.      `-B' prefixes that effectively specify directory names also apply
  3673.      to libraries in the linker, because the compiler translates these
  3674.      options into `-L' options for the linker.  They also apply to
  3675.      includes files in the preprocessor, because the compiler
  3676.      translates these options into `-isystem' options for the
  3677.      preprocessor.  In this case, the compiler appends `include' to the
  3678.      prefix.
  3679.  
  3680.      The run-time support file `libgcc.a' can also be searched for using
  3681.      the `-B' prefix, if needed.  If it is not found there, the two
  3682.      standard prefixes above are tried, and that is all.  The file is
  3683.      left out of the link if it is not found by those means.
  3684.  
  3685.      Another way to specify a prefix much like the `-B' prefix is to use
  3686.      the environment variable `GPC_EXEC_PREFIX'.  *Note Environment
  3687.      Variables::.
  3688.  
  3689. 
  3690. File: ^.!gcc.docs.pascal.gpc,  Node: Target Options,  Next: Submodel Options,  Prev: Directory Options,  Up: Invoking GPC
  3691.  
  3692. Specifying Target Machine and Compiler Version
  3693. ==============================================
  3694.  
  3695.    By default, GNU Pascal compiles code for the same type of machine
  3696. that you are using.  However, it can also be installed as a
  3697. cross-compiler, to compile for some other type of machine.  In fact,
  3698. several different configurations of GNU Pascal, for different target
  3699. machines, can be installed side by side.  Then you specify which one to
  3700. use with the `-b' option.
  3701.  
  3702.    In addition, older and newer versions of GNU Pascal can be installed
  3703. side by side.  One of them (probably the newest) will be the default,
  3704. but you may sometimes wish to use another.
  3705.  
  3706. `-b MACHINE'
  3707.      The argument MACHINE specifies the target machine for compilation.
  3708.      This is useful when you have installed GNU Pascal as a
  3709.      cross-compiler.
  3710.  
  3711.      The value to use for MACHINE is the same as was specified as the
  3712.      machine type when configuring GNU Pascal as a cross-compiler.  For
  3713.      example, if a cross-compiler was configured with `configure
  3714.      i386v', meaning to compile for an 80386 running System V, then you
  3715.      would specify `-b i386v' to run that cross compiler.
  3716.  
  3717.      When you do not specify `-b', it normally means to compile for the
  3718.      same type of machine that you are using.
  3719.  
  3720. `-V VERSION'
  3721.      The argument VERSION specifies which version of GNU Pascal to run.
  3722.      This is useful when multiple versions are installed.  For example,
  3723.      VERSION might be `2.0', meaning to run GNU Pascal version 2.0.
  3724.  
  3725.      The default version, when you do not specify `-V', is the last
  3726.      version of GNU Pascal that you installed.
  3727.  
  3728.    The `-b' and `-V' options actually work by controlling part of the
  3729. file name used for the executable files and libraries used for
  3730. compilation.  A given version of GNU Pascal, for a given target
  3731. machine, is normally kept in the directory
  3732. `/usr/local/lib/gcc-lib/MACHINE/VERSION'.
  3733.  
  3734.    Thus, sites can customize the effect of `-b' or `-V' either by
  3735. changing the names of these directories or adding alternate names (or
  3736. symbolic links).  If in directory `/usr/local/lib/gcc-lib/' the file
  3737. `80386' is a link to the file `i386v', then `-b 80386' becomes an alias
  3738. for `-b i386v'.
  3739.  
  3740.    In one respect, the `-b' or `-V' do not completely change to a
  3741. different compiler: the top-level driver program `gpc' that you
  3742. originally invoked continues to run and invoke the other executables
  3743. (preprocessor, compiler per se, assembler and linker) that do the real
  3744. work.  However, since no real work is done in the driver program, it
  3745. usually does not matter that the driver program in use is not the one
  3746. for the specified target and version.
  3747.  
  3748.    The only way that the driver program depends on the target machine is
  3749. in the parsing and handling of special machine-specific options.
  3750. However, this is controlled by a file which is found, along with the
  3751. other executables, in the directory for the specified version and
  3752. target machine.  As a result, a single installed driver program adapts
  3753. to any specified target machine and compiler version.
  3754.  
  3755.    The driver program executable does control one significant thing,
  3756. however: the default version and target machine.  Therefore, you can
  3757. install different instances of the driver program, compiled for
  3758. different targets or versions, under different names.
  3759.  
  3760.    For example, if the driver for version 2.0 is installed as `ogcc'
  3761. and that for version 2.1 is installed as `gpc', then the command `gpc'
  3762. will use version 2.1 by default, while `ogcc' will use 2.0 by default.
  3763. However, you can choose either version with either command with the
  3764. `-V' option.
  3765.  
  3766. 
  3767. File: ^.!gcc.docs.pascal.gpc,  Node: Submodel Options,  Next: Environment Variables,  Prev: Target Options,  Up: Invoking GPC
  3768.  
  3769. Hardware Models and Configurations
  3770. ==================================
  3771.  
  3772.    Earlier we discussed the standard option `-b' which chooses among
  3773. different installed compilers for completely different target machines,
  3774. such as Vax vs. 68000 vs. 80386.
  3775.  
  3776.    In addition, each of these target machine types can have its own
  3777. special options, starting with `-m', to choose among various hardware
  3778. models or configurations--for example, 68010 vs 68020, floating
  3779. coprocessor or none.  A single installed version of the compiler can
  3780. compile for any model or configuration, according to the options
  3781. specified.
  3782.  
  3783.    Some configurations of the compiler also support additional special
  3784. options, usually for compatibility with other compilers on the same
  3785. platform.
  3786.  
  3787. * Menu:
  3788.  
  3789. * M680x0 Options::
  3790. * VAX Options::
  3791. * SPARC Options::
  3792. * Convex Options::
  3793. * AMD29K Options::
  3794. * ARM Options::
  3795. * M88K Options::
  3796. * RS/6000 and PowerPC Options::
  3797. * RT Options::
  3798. * MIPS Options::
  3799. * i386 Options::
  3800. * HPPA Options::
  3801. * Intel 960 Options::
  3802. * DEC Alpha Options::
  3803. * Clipper Options::
  3804. * H8/300 Options::
  3805. * System V Options::
  3806.  
  3807. 
  3808. File: ^.!gcc.docs.pascal.gpc,  Node: M680x0 Options,  Next: VAX Options,  Up: Submodel Options
  3809.  
  3810. M680x0 Options
  3811. --------------
  3812.  
  3813.    These are the `-m' options defined for the 68000 series.  The default
  3814. values for these options depends on which style of 68000 was selected
  3815. when the compiler was configured; the defaults for the most common
  3816. choices are given below.
  3817.  
  3818. `-m68000'
  3819. `-mc68000'
  3820.      Generate output for a 68000.  This is the default when the
  3821.      compiler is configured for 68000-based systems.
  3822.  
  3823. `-m68020'
  3824. `-mc68020'
  3825.      Generate output for a 68020.  This is the default when the
  3826.      compiler is configured for 68020-based systems.
  3827.  
  3828. `-m68881'
  3829.      Generate output containing 68881 instructions for floating point.
  3830.      This is the default for most 68020 systems unless `-nfp' was
  3831.      specified when the compiler was configured.
  3832.  
  3833. `-m68030'
  3834.      Generate output for a 68030.  This is the default when the
  3835.      compiler is configured for 68030-based systems.
  3836.  
  3837. `-m68040'
  3838.      Generate output for a 68040.  This is the default when the
  3839.      compiler is configured for 68040-based systems.
  3840.  
  3841.      This option inhibits the use of 68881/68882 instructions that have
  3842.      to be emulated by software on the 68040.  If your 68040 does not
  3843.      have code to emulate those instructions, use `-m68040'.
  3844.  
  3845. `-m68020-40'
  3846.      Generate output for a 68040, without using any of the new
  3847.      instructions.  This results in code which can run relatively
  3848.      efficiently on either a 68020/68881 or a 68030 or a 68040.  The
  3849.      generated code does use the 68881 instructions that are emulated
  3850.      on the 68040.
  3851.  
  3852. `-mfpa'
  3853.      Generate output containing Sun FPA instructions for floating point.
  3854.  
  3855. `-msoft-float'
  3856.      Generate output containing library calls for floating point.
  3857.      *Warning:* the requisite libraries are not available for all m68k
  3858.      targets.  Normally the facilities of the machine's usual C
  3859.      compiler are used, but this can't be done directly in
  3860.      cross-compilation.  You must make your own arrangements to provide
  3861.      suitable library functions for cross-compilation.  The embedded
  3862.      targets `m68k-*-aout' and `m68k-*-coff' do provide software
  3863.      floating point support.
  3864.  
  3865. `-mshort'
  3866.      Consider type `int' to be 16 bits wide, like `short int'.
  3867.  
  3868. `-mnobitfield'
  3869.      Do not use the bit-field instructions.  The `-m68000' option
  3870.      implies `-mnobitfield'.
  3871.  
  3872. `-mbitfield'
  3873.      Do use the bit-field instructions.  The `-m68020' option implies
  3874.      `-mbitfield'.  This is the default if you use a configuration
  3875.      designed for a 68020.
  3876.  
  3877. `-mrtd'
  3878.      Use a different function-calling convention, in which functions
  3879.      that take a fixed number of arguments return with the `rtd'
  3880.      instruction, which pops their arguments while returning.  This
  3881.      saves one instruction in the caller since there is no need to pop
  3882.      the arguments there.
  3883.  
  3884.      This calling convention is incompatible with the one normally used
  3885.      on Unix, so you cannot use it if you need to call libraries
  3886.      compiled with the Unix compiler.
  3887.  
  3888.      Also, you must provide function prototypes for all functions that
  3889.      take variable numbers of arguments (including `printf'); otherwise
  3890.      incorrect code will be generated for calls to those functions.
  3891.  
  3892.      In addition, seriously incorrect code will result if you call a
  3893.      function with too many arguments.  (Normally, extra arguments are
  3894.      harmlessly ignored.)
  3895.  
  3896.      The `rtd' instruction is supported by the 68010 and 68020
  3897.      processors, but not by the 68000.
  3898.  
  3899. 
  3900. File: ^.!gcc.docs.pascal.gpc,  Node: VAX Options,  Next: SPARC Options,  Prev: M680x0 Options,  Up: Submodel Options
  3901.  
  3902. VAX Options
  3903. -----------
  3904.  
  3905.    These `-m' options are defined for the Vax:
  3906.  
  3907. `-munix'
  3908.      Do not output certain jump instructions (`aobleq' and so on) that
  3909.      the Unix assembler for the Vax cannot handle across long ranges.
  3910.  
  3911. `-mgnu'
  3912.      Do output those jump instructions, on the assumption that you will
  3913.      assemble with the GNU assembler.
  3914.  
  3915. `-mg'
  3916.      Output code for g-format floating point numbers instead of
  3917.      d-format.
  3918.  
  3919. 
  3920. File: ^.!gcc.docs.pascal.gpc,  Node: SPARC Options,  Next: Convex Options,  Prev: VAX Options,  Up: Submodel Options
  3921.  
  3922. SPARC Options
  3923. -------------
  3924.  
  3925.    These `-m' switches are supported on the SPARC:
  3926.  
  3927. `-mno-app-regs'
  3928. `-mapp-regs'
  3929.      Specify `-mapp-regs' to generate output using the global registers
  3930.      2 through 4, which the SPARC SVR4 ABI reserves for applications.
  3931.      This is the default.
  3932.  
  3933.      To be fully SVR4 ABI compliant at the cost of some performance
  3934.      loss, specify `-mno-app-regs'.  You should compile libraries and
  3935.      system software with this option.
  3936.  
  3937. `-mfpu'
  3938. `-mhard-float'
  3939.      Generate output containing floating point instructions.  This is
  3940.      the default.
  3941.  
  3942. `-mno-fpu'
  3943. `-msoft-float'
  3944.      Generate output containing library calls for floating point.
  3945.      *Warning:* the requisite libraries are not available for all SPARC
  3946.      targets.  Normally the facilities of the machine's usual C
  3947.      compiler are used, but this cannot be done directly in
  3948.      cross-compilation.  You must make your own arrangements to provide
  3949.      suitable library functions for cross-compilation.  The embedded
  3950.      targets `sparc-*-aout' and `sparclite-*-*' do provide software
  3951.      floating point support.
  3952.  
  3953.      `-msoft-float' changes the calling convention in the output file;
  3954.      therefore, it is only useful if you compile *all* of a program with
  3955.      this option.  In particular, you need to compile `libgcc.a', the
  3956.      library that comes with GNU Pascal, with `-msoft-float' in order
  3957.      for this to work.
  3958.  
  3959. `-mhard-quad-float'
  3960.      Generate output containing quad-word (long double) floating point
  3961.      instructions.
  3962.  
  3963. `-msoft-quad-float'
  3964.      Generate output containing library calls for quad-word (long
  3965.      double) floating point instructions.  The functions called are
  3966.      those specified in the SPARC ABI.  This is the default.
  3967.  
  3968.      As of this writing, there are no sparc implementations that have
  3969.      hardware support for the quad-word floating point instructions.
  3970.      They all invoke a trap handler for one of these instructions, and
  3971.      then the trap handler emulates the effect of the instruction.
  3972.      Because of the trap handler overhead, this is much slower than
  3973.      calling the ABI library routines.  Thus the `-msoft-quad-float'
  3974.      option is the default.
  3975.  
  3976. `-mno-epilogue'
  3977. `-mepilogue'
  3978.      With `-mepilogue' (the default), the compiler always emits code for
  3979.      function exit at the end of each function.  Any function exit in
  3980.      the middle of the function (such as a return statement in C) will
  3981.      generate a jump to the exit code at the end of the function.
  3982.  
  3983.      With `-mno-epilogue', the compiler tries to emit exit code inline
  3984.      at every function exit.
  3985.  
  3986. `-mno-flat'
  3987. `-mflat'
  3988.      With `-mflat', the compiler does not generate save/restore
  3989.      instructions and will use a "flat" or single register window
  3990.      calling convention.  This model uses %i7 as the frame pointer and
  3991.      is compatible with the normal register window model.  Code from
  3992.      either may be intermixed although debugger support is still
  3993.      incomplete.  The local registers and the input registers (0-5) are
  3994.      still treated as "call saved" registers and will be saved on the
  3995.      stack as necessary.
  3996.  
  3997.      With `-mno-flat' (the default), the compiler emits save/restore
  3998.      instructions (except for leaf functions) and is the normal mode of
  3999.      operation.
  4000.  
  4001. `-mno-unaligned-doubles'
  4002. `-munaligned-doubles'
  4003.      Assume that doubles have 8 byte alignment.  This is the default.
  4004.  
  4005.      With `-munaligned-doubles', GNU Pascal assumes that doubles have 8
  4006.      byte alignment only if they are contained in another type, or if
  4007.      they have an absolute address.  Otherwise, it assumes they have 4
  4008.      byte alignment.  Specifying this option avoids some rare
  4009.      compatibility problems with code generated by other compilers.  It
  4010.      is not the default because it results in a performance loss,
  4011.      especially for floating point code.
  4012.  
  4013. `-mv8'
  4014. `-msparclite'
  4015.      These two options select variations on the SPARC architecture.
  4016.  
  4017.      By default (unless specifically configured for the Fujitsu
  4018.      SPARClite), GPC generates code for the v7 variant of the SPARC
  4019.      architecture.
  4020.  
  4021.      `-mv8' will give you SPARC v8 code.  The only difference from v7
  4022.      code is that the compiler emits the integer multiply and integer
  4023.      divide instructions which exist in SPARC v8 but not in SPARC v7.
  4024.  
  4025.      `-msparclite' will give you SPARClite code.  This adds the integer
  4026.      multiply, integer divide step and scan (`ffs') instructions which
  4027.      exist in SPARClite but not in SPARC v7.
  4028.  
  4029. `-mcypress'
  4030. `-msupersparc'
  4031.      These two options select the processor for which the code is
  4032.      optimised.
  4033.  
  4034.      With `-mcypress' (the default), the compiler optimizes code for the
  4035.      Cypress CY7C602 chip, as used in the SparcStation/SparcServer 3xx
  4036.      series.  This is also appropriate for the older SparcStation 1, 2,
  4037.      IPX etc.
  4038.  
  4039.      With `-msupersparc' the compiler optimizes code for the SuperSparc
  4040.      cpu, as used in the SparcStation 10, 1000 and 2000 series. This
  4041.      flag also enables use of the full SPARC v8 instruction set.
  4042.  
  4043.    In a future version of GPC, these options will very likely be
  4044. renamed to `-mcpu=cypress' and `-mcpu=supersparc'.
  4045.  
  4046.    These `-m' switches are supported in addition to the above on SPARC
  4047. V9 processors:
  4048.  
  4049. `-mmedlow'
  4050.      Generate code for the Medium/Low code model: assume a 32 bit
  4051.      address space.  Programs are statically linked, PIC is not
  4052.      supported.  Pointers are still 64 bits.
  4053.  
  4054.      It is very likely that a future version of GPC will rename this
  4055.      option.
  4056.  
  4057. `-mmedany'
  4058.      Generate code for the Medium/Anywhere code model: assume a 32 bit
  4059.      text segment starting at offset 0, and a 32 bit data segment
  4060.      starting anywhere (determined at link time).  Programs are
  4061.      statically linked, PIC is not supported.  Pointers are still 64
  4062.      bits.
  4063.  
  4064.      It is very likely that a future version of GPC will rename this
  4065.      option.
  4066.  
  4067. `-mint64'
  4068.      Types long and int are 64 bits.
  4069.  
  4070. `-mlong32'
  4071.      Types long and int are 32 bits.
  4072.  
  4073. `-mlong64'
  4074. `-mint32'
  4075.      Type long is 64 bits, and type int is 32 bits.
  4076.  
  4077. `-mstack-bias'
  4078. `-mno-stack-bias'
  4079.      With `-mstack-bias', GNU Pascal assumes that the stack pointer, and
  4080.      frame pointer if present, are offset by -2047 which must be added
  4081.      back when making stack frame references.  Otherwise, assume no
  4082.      such offset is present.
  4083.  
  4084. 
  4085. File: ^.!gcc.docs.pascal.gpc,  Node: Convex Options,  Next: AMD29K Options,  Prev: SPARC Options,  Up: Submodel Options
  4086.  
  4087. Convex Options
  4088. --------------
  4089.  
  4090.    These `-m' options are defined for Convex:
  4091.  
  4092. `-mc1'
  4093.      Generate output for C1.  The code will run on any Convex machine.
  4094.      The preprocessor symbol `__convex__c1__' is defined.
  4095.  
  4096. `-mc2'
  4097.      Generate output for C2.  Uses instructions not available on C1.
  4098.      Scheduling and other optimizations are chosen for max performance
  4099.      on C2.  The preprocessor symbol `__convex_c2__' is defined.
  4100.  
  4101. `-mc32'
  4102.      Generate output for C32xx.  Uses instructions not available on C1.
  4103.      Scheduling and other optimizations are chosen for max performance
  4104.      on C32.  The preprocessor symbol `__convex_c32__' is defined.
  4105.  
  4106. `-mc34'
  4107.      Generate output for C34xx.  Uses instructions not available on C1.
  4108.      Scheduling and other optimizations are chosen for max performance
  4109.      on C34.  The preprocessor symbol `__convex_c34__' is defined.
  4110.  
  4111. `-mc38'
  4112.      Generate output for C38xx.  Uses instructions not available on C1.
  4113.      Scheduling and other optimizations are chosen for max performance
  4114.      on C38.  The preprocessor symbol `__convex_c38__' is defined.
  4115.  
  4116. `-margcount'
  4117.      Generate code which puts an argument count in the word preceding
  4118.      each argument list.  This is compatible with regular CC, and a few
  4119.      programs may need the argument count word.  GDB and other
  4120.      source-level debuggers do not need it; this info is in the symbol
  4121.      table.
  4122.  
  4123. `-mnoargcount'
  4124.      Omit the argument count word.  This is the default.
  4125.  
  4126. `-mvolatile-cache'
  4127.      Allow volatile references to be cached.  This is the default.
  4128.  
  4129. `-mvolatile-nocache'
  4130.      Volatile references bypass the data cache, going all the way to
  4131.      memory.  This is only needed for multi-processor code that does
  4132.      not use standard synchronization instructions.  Making
  4133.      non-volatile references to volatile locations will not necessarily
  4134.      work.
  4135.  
  4136. `-mlong32'
  4137.      Type long is 32 bits, the same as type int.  This is the default.
  4138.  
  4139. `-mlong64'
  4140.      Type long is 64 bits, the same as type long long.  This option is
  4141.      useless, because no library support exists for it.
  4142.  
  4143. 
  4144. File: ^.!gcc.docs.pascal.gpc,  Node: AMD29K Options,  Next: ARM Options,  Prev: Convex Options,  Up: Submodel Options
  4145.  
  4146. AMD29K Options
  4147. --------------
  4148.  
  4149.    These `-m' options are defined for the AMD Am29000:
  4150.  
  4151. `-mdw'
  4152.      Generate code that assumes the `DW' bit is set, i.e., that byte and
  4153.      halfword operations are directly supported by the hardware.  This
  4154.      is the default.
  4155.  
  4156. `-mndw'
  4157.      Generate code that assumes the `DW' bit is not set.
  4158.  
  4159. `-mbw'
  4160.      Generate code that assumes the system supports byte and halfword
  4161.      write operations.  This is the default.
  4162.  
  4163. `-mnbw'
  4164.      Generate code that assumes the systems does not support byte and
  4165.      halfword write operations.  `-mnbw' implies `-mndw'.
  4166.  
  4167. `-msmall'
  4168.      Use a small memory model that assumes that all function addresses
  4169.      are either within a single 256 KB segment or at an absolute
  4170.      address of less than 256k.  This allows the `call' instruction to
  4171.      be used instead of a `const', `consth', `calli' sequence.
  4172.  
  4173. `-mnormal'
  4174.      Use the normal memory model: Generate `call' instructions only when
  4175.      calling functions in the same file and `calli' instructions
  4176.      otherwise.  This works if each file occupies less than 256 KB but
  4177.      allows the entire executable to be larger than 256 KB.  This is
  4178.      the default.
  4179.  
  4180. `-mlarge'
  4181.      Always use `calli' instructions.  Specify this option if you expect
  4182.      a single file to compile into more than 256 KB of code.
  4183.  
  4184. `-m29050'
  4185.      Generate code for the Am29050.
  4186.  
  4187. `-m29000'
  4188.      Generate code for the Am29000.  This is the default.
  4189.  
  4190. `-mkernel-registers'
  4191.      Generate references to registers `gr64-gr95' instead of to
  4192.      registers `gr96-gr127'.  This option can be used when compiling
  4193.      kernel code that wants a set of global registers disjoint from
  4194.      that used by user-mode code.
  4195.  
  4196.      Note that when this option is used, register names in `-f' flags
  4197.      must use the normal, user-mode, names.
  4198.  
  4199. `-muser-registers'
  4200.      Use the normal set of global registers, `gr96-gr127'.  This is the
  4201.      default.
  4202.  
  4203. `-mstack-check'
  4204. `-mno-stack-check'
  4205.      Insert (or do not insert) a call to `__msp_check' after each stack
  4206.      adjustment.  This is often used for kernel code.
  4207.  
  4208. `-mstorem-bug'
  4209. `-mno-storem-bug'
  4210.      `-mstorem-bug' handles 29k processors which cannot handle the
  4211.      separation of a mtsrim insn and a storem instruction (most 29000
  4212.      chips to date, but not the 29050).
  4213.  
  4214. `-mno-reuse-arg-regs'
  4215. `-mreuse-arg-regs'
  4216.      `-mno-reuse-arg-regs' tells the compiler to only use incoming
  4217.      argument registers for copying out arguments.  This helps detect
  4218.      calling a function with fewer arguments than it was declared with.
  4219.  
  4220. `-msoft-float'
  4221.      Generate output containing library calls for floating point.
  4222.      *Warning:* the requisite libraries are not part of GNU Pascal.
  4223.      Normally the facilities of the machine's usual C compiler are
  4224.      used, but this can't be done directly in cross-compilation.  You
  4225.      must make your own arrangements to provide suitable library
  4226.      functions for cross-compilation.
  4227.  
  4228. 
  4229. File: ^.!gcc.docs.pascal.gpc,  Node: ARM Options,  Next: M88K Options,  Prev: AMD29K Options,  Up: Submodel Options
  4230.  
  4231. ARM Options
  4232. -----------
  4233.  
  4234.    These `-m' options are defined for Advanced RISC Machines (ARM)
  4235. architectures:
  4236.  
  4237. `-m2'
  4238. `-m3'
  4239.      These options are identical.  Generate code for the ARM2 and ARM3
  4240.      processors.  This option is the default.  You should also use this
  4241.      option to generate code for ARM6 processors that are running with a
  4242.      26-bit program counter.
  4243.  
  4244. `-m6'
  4245.      Generate code for the ARM6 processor when running with a 32-bit
  4246.      program counter.
  4247.  
  4248. `-mapcs'
  4249.      Generate a stack frame that is compliant with the ARM Procedure
  4250.      Call Standard for all functions, even if this is not strictly
  4251.      necessary for correct execution of the code.
  4252.  
  4253. `-mbsd'
  4254.      This option only applies to RISC iX.  Emulate the native BSD-mode
  4255.      compiler.  This is the default if `-ansi' is not specified.
  4256.  
  4257. `-mxopen'
  4258.      This option only applies to RISC iX.  Emulate the native
  4259.      X/Open-mode compiler.
  4260.  
  4261. `-mno-symrename'
  4262.      This option only applies to RISC iX.  Do not run the assembler
  4263.      post-processor, `symrename', after code has been assembled.
  4264.      Normally it is necessary to modify some of the standard symbols in
  4265.      preparation for linking with the RISC iX C library; this option
  4266.      suppresses this pass.  The post-processor is never run when the
  4267.      compiler is built for cross-compilation.
  4268.  
  4269. 
  4270. File: ^.!gcc.docs.pascal.gpc,  Node: M88K Options,  Next: RS/6000 and PowerPC Options,  Prev: ARM Options,  Up: Submodel Options
  4271.  
  4272. M88K Options
  4273. ------------
  4274.  
  4275.    These `-m' options are defined for Motorola 88k architectures:
  4276.  
  4277. `-m88000'
  4278.      Generate code that works well on both the m88100 and the m88110.
  4279.  
  4280. `-m88100'
  4281.      Generate code that works best for the m88100, but that also runs
  4282.      on the m88110.
  4283.  
  4284. `-m88110'
  4285.      Generate code that works best for the m88110, and may not run on
  4286.      the m88100.
  4287.  
  4288. `-mbig-pic'
  4289.      Obsolete option to be removed from the next revision.  Use `-fPIC'.
  4290.  
  4291. `-midentify-revision'
  4292.      Include an `ident' directive in the assembler output recording the
  4293.      source file name, compiler name and version, timestamp, and
  4294.      compilation flags used.
  4295.  
  4296. `-mno-underscores'
  4297.      In assembler output, emit symbol names without adding an underscore
  4298.      character at the beginning of each name.  The default is to use an
  4299.      underscore as prefix on each name.
  4300.  
  4301. `-mocs-debug-info'
  4302. `-mno-ocs-debug-info'
  4303.      Include (or omit) additional debugging information (about
  4304.      registers used in each stack frame) as specified in the 88open
  4305.      Object Compatibility Standard, "OCS".  This extra information
  4306.      allows debugging of code that has had the frame pointer
  4307.      eliminated.  The default for DG/UX, SVr4, and Delta 88 SVr3.2 is
  4308.      to include this information; other 88k configurations omit this
  4309.      information by default.
  4310.  
  4311. `-mocs-frame-position'
  4312.      When emitting COFF debugging information for automatic variables
  4313.      and parameters stored on the stack, use the offset from the
  4314.      canonical frame address, which is the stack pointer (register 31)
  4315.      on entry to the function.  The DG/UX, SVr4, Delta88 SVr3.2, and
  4316.      BCS configurations use `-mocs-frame-position'; other 88k
  4317.      configurations have the default `-mno-ocs-frame-position'.
  4318.  
  4319. `-mno-ocs-frame-position'
  4320.      When emitting COFF debugging information for automatic variables
  4321.      and parameters stored on the stack, use the offset from the frame
  4322.      pointer register (register 30).  When this option is in effect,
  4323.      the frame pointer is not eliminated when debugging information is
  4324.      selected by the -g switch.
  4325.  
  4326. `-moptimize-arg-area'
  4327. `-mno-optimize-arg-area'
  4328.      Control how function arguments are stored in stack frames.
  4329.      `-moptimize-arg-area' saves space by optimizing them, but this
  4330.      conflicts with the 88open specifications.  The opposite
  4331.      alternative, `-mno-optimize-arg-area', agrees with 88open
  4332.      standards.  By default GNU Pascal does not optimize the argument
  4333.      area.
  4334.  
  4335. `-mshort-data-NUM'
  4336.      Generate smaller data references by making them relative to `r0',
  4337.      which allows loading a value using a single instruction (rather
  4338.      than the usual two).  You control which data references are
  4339.      affected by specifying NUM with this option.  For example, if you
  4340.      specify `-mshort-data-512', then the data references affected are
  4341.      those involving displacements of less than 512 bytes.
  4342.      `-mshort-data-NUM' is not effective for NUM greater than 64k.
  4343.  
  4344. `-mserialize-volatile'
  4345. `-mno-serialize-volatile'
  4346.      Do, or don't, generate code to guarantee sequential consistency of
  4347.      volatile memory references.  By default, consistency is guaranteed.
  4348.  
  4349.      The order of memory references made by the MC88110 processor does
  4350.      not always match the order of the instructions requesting those
  4351.      references.  In particular, a load instruction may execute before
  4352.      a preceding store instruction.  Such reordering violates
  4353.      sequential consistency of volatile memory references, when there
  4354.      are multiple processors.   When consistency must be guaranteed,
  4355.      GNU Pascal generates special instructions, as needed, to force
  4356.      execution in the proper order.
  4357.  
  4358.      The MC88100 processor does not reorder memory references and so
  4359.      always provides sequential consistency.  However, by default, GNU
  4360.      C generates the special instructions to guarantee consistency even
  4361.      when you use `-m88100', so that the code may be run on an MC88110
  4362.      processor.  If you intend to run your code only on the MC88100
  4363.      processor, you may use `-mno-serialize-volatile'.
  4364.  
  4365.      The extra code generated to guarantee consistency may affect the
  4366.      performance of your application.  If you know that you can safely
  4367.      forgo this guarantee, you may use `-mno-serialize-volatile'.
  4368.  
  4369. `-msvr4'
  4370. `-msvr3'
  4371.      Turn on (`-msvr4') or off (`-msvr3') compiler extensions related
  4372.      to System V release 4 (SVr4).  This controls the following:
  4373.  
  4374.        1. Which variant of the assembler syntax to emit.
  4375.  
  4376.        2. `-msvr4' makes the Pascal preprocessor recognize `#pragma
  4377.           weak' that is used on System V release 4.
  4378.  
  4379.        3. `-msvr4' makes GNU Pascal issue additional declaration
  4380.           directives used in SVr4.
  4381.  
  4382.      `-msvr4' is the default for the m88k-motorola-sysv4 and
  4383.      m88k-dg-dgux m88k configurations. `-msvr3' is the default for all
  4384.      other m88k configurations.
  4385.  
  4386. `-mversion-03.00'
  4387.      This option is obsolete, and is ignored.
  4388.  
  4389. `-mno-check-zero-division'
  4390. `-mcheck-zero-division'
  4391.      Do, or don't, generate code to guarantee that integer division by
  4392.      zero will be detected.  By default, detection is guaranteed.
  4393.  
  4394.      Some models of the MC88100 processor fail to trap upon integer
  4395.      division by zero under certain conditions.  By default, when
  4396.      compiling code that might be run on such a processor, GNU C
  4397.      generates code that explicitly checks for zero-valued divisors and
  4398.      traps with exception number 503 when one is detected.  Use of
  4399.      mno-check-zero-division suppresses such checking for code
  4400.      generated to run on an MC88100 processor.
  4401.  
  4402.      GNU Pascal assumes that the MC88110 processor correctly detects all
  4403.      instances of integer division by zero.  When `-m88110' is
  4404.      specified, both `-mcheck-zero-division' and
  4405.      `-mno-check-zero-division' are ignored, and no explicit checks for
  4406.      zero-valued divisors are generated.
  4407.  
  4408. `-muse-div-instruction'
  4409.      Use the div instruction for signed integer division on the MC88100
  4410.      processor.  By default, the div instruction is not used.
  4411.  
  4412.      On the MC88100 processor the signed integer division instruction
  4413.      div) traps to the operating system on a negative operand.  The
  4414.      operating system transparently completes the operation, but at a
  4415.      large cost in execution time.  By default, when compiling code
  4416.      that might be run on an MC88100 processor, GNU Pascal emulates
  4417.      signed integer division using the unsigned integer division
  4418.      instruction divu), thereby avoiding the large penalty of a trap to
  4419.      the operating system.  Such emulation has its own, smaller,
  4420.      execution cost in both time and space.  To the extent that your
  4421.      code's important signed integer division operations are performed
  4422.      on two nonnegative operands, it may be desirable to use the div
  4423.      instruction directly.
  4424.  
  4425.      On the MC88110 processor the div instruction (also known as the
  4426.      divs instruction) processes negative operands without trapping to
  4427.      the operating system.  When `-m88110' is specified,
  4428.      `-muse-div-instruction' is ignored, and the div instruction is used
  4429.      for signed integer division.
  4430.  
  4431.      Note that the result of dividing INT_MIN by -1 is undefined.  In
  4432.      particular, the behavior of such a division with and without
  4433.      `-muse-div-instruction'  may differ.
  4434.  
  4435. `-mtrap-large-shift'
  4436. `-mhandle-large-shift'
  4437.      Include code to detect bit-shifts of more than 31 bits;
  4438.      respectively, trap such shifts or emit code to handle them
  4439.      properly.  By default GNU Pascal makes no special provision for
  4440.      large bit shifts.
  4441.  
  4442. `-mwarn-passed-structs'
  4443.      Warn when a function passes a struct as an argument or result.
  4444.      Structure-passing conventions have changed during the evolution of
  4445.      the C language, and are often the source of portability problems.
  4446.      By default, GNU Pascal issues no such warning.
  4447.  
  4448. 
  4449. File: ^.!gcc.docs.pascal.gpc,  Node: RS/6000 and PowerPC Options,  Next: RT Options,  Prev: M88K Options,  Up: Submodel Options
  4450.  
  4451. IBM RS/6000 and PowerPC Options
  4452. -------------------------------
  4453.  
  4454.    These `-m' options are defined for the IBM RS/6000 and PowerPC:
  4455. `-mpower'
  4456. `-mno-power'
  4457. `-mpower2'
  4458. `-mno-power2'
  4459. `-mpowerpc'
  4460. `-mno-powerpc'
  4461. `-mpowerpc-gpopt'
  4462. `-mno-powerpc-gpopt'
  4463. `-mpowerpc-gfxopt'
  4464. `-mno-powerpc-gfxopt'
  4465.      GNU Pascal supports two related instruction set architectures for
  4466.      the RS/6000 and PowerPC.  The "POWER" instruction set are those
  4467.      instructions supported by the `rios' chip set used in the original
  4468.      RS/6000 systems and the "PowerPC" instruction set is the
  4469.      architecture of the Motorola MPC6xx microprocessors.  The PowerPC
  4470.      architecture defines 64-bit instructions, but they are not
  4471.      supported by any current processors.
  4472.  
  4473.      Neither architecture is a subset of the other.  However there is a
  4474.      large common subset of instructions supported by both.  An MQ
  4475.      register is included in processors supporting the POWER
  4476.      architecture.
  4477.  
  4478.      You use these options to specify which instructions are available
  4479.      on the processor you are using.  The default value of these
  4480.      options is determined when configuring GNU Pascal.  Specifying the
  4481.      `-mcpu=CPU_TYPE' overrides the specification of these options.  We
  4482.      recommend you use that option rather than these.
  4483.  
  4484.      The `-mpower' option allows GNU Pascal to generate instructions
  4485.      that are found only in the POWER architecture and to use the MQ
  4486.      register.  Specifying `-mpower2' implies `-power' and also allows
  4487.      GNU Pascal to generate instructions that are present in the POWER2
  4488.      architecture but not the original POWER architecture.
  4489.  
  4490.      The `-mpowerpc' option allows GNU Pascal to generate instructions
  4491.      that are found only in the 32-bit subset of the PowerPC
  4492.      architecture.  Specifying `-mpowerpc-gpopt' implies `-mpowerpc'
  4493.      and also allows GNU Pascal to use the optional PowerPC
  4494.      architecture instructions in the General Purpose group, including
  4495.      floating-point square root.  Specifying `-mpowerpc-gfxopt' implies
  4496.      `-mpowerpc' and also allows GNU Pascal to use the optional PowerPC
  4497.      architecture instructions in the Graphics group, including
  4498.      floating-point select.
  4499.  
  4500.      If you specify both `-mno-power' and `-mno-powerpc', GNU Pascal
  4501.      will use only the instructions in the common subset of both
  4502.      architectures plus some special AIX common-mode calls, and will
  4503.      not use the MQ register.  Specifying both `-mpower' and `-mpowerpc'
  4504.      permits GNU Pascal to use any instruction from either architecture
  4505.      and to allow use of the MQ register; specify this for the Motorola
  4506.      MPC601.
  4507.  
  4508. `-mnew-mnemonics'
  4509. `-mold-mnemonics'
  4510.      Select which mnemonics to use in the generated assembler code.
  4511.      `-mnew-mnemonics' requests output that uses the assembler mnemonics
  4512.      defined for the PowerPC architecture, while `-mold-mnemonics'
  4513.      requests the assembler mnemonics defined for the POWER
  4514.      architecture.  Instructions defined in only one architecture have
  4515.      only one mnemonic; GNU Pascal uses that mnemonic irrespective of
  4516.      which of these options is specified.
  4517.  
  4518.      PowerPC assemblers support both the old and new mnemonics, as will
  4519.      later POWER assemblers.  Current POWER assemblers only support the
  4520.      old mnemonics.  Specify `-mnew-mnemonics' if you have an assembler
  4521.      that supports them, otherwise specify `-mold-mnemonics'.
  4522.  
  4523.      The default value of these options depends on how GNU Pascal was
  4524.      configured.  Specifying `-mcpu=CPU_TYPE' sometimes overrides the
  4525.      value of these option.  Unless you are building a cross-compiler,
  4526.      you should normally not specify either `-mnew-mnemonics' or
  4527.      `-mold-mnemonics', but should instead accept the default.
  4528.  
  4529. `-mcpu=CPU_TYPE'
  4530.      Set architecture type, register usage, choice of mnemonics, and
  4531.      instruction scheduling parameters for machine type CPU_TYPE.  By
  4532.      default, CPU_TYPE is the target system defined when GNU Pascal was
  4533.      configured.  Supported values for CPU_TYPE are `rios1', `rios2',
  4534.      `rsc', `601', `603', `604', `power', `powerpc', `403', and
  4535.      `common'.  `-mcpu=power' and `-mcpu=powerpc' specify generic POWER
  4536.      and pure PowerPC (i.e., not MPC601) architecture machine types,
  4537.      with an appropriate, generic processor model assumed for
  4538.      scheduling purposes.
  4539.  
  4540.      Specifying `-mcpu=rios1', `-mcpu=rios2', `-mcpu=rsc', or
  4541.      `-mcpu=power' enables the `-mpower' option and disables the
  4542.      `-mpowerpc' option; `-mcpu=601' enables both the `-mpower' and
  4543.      `-mpowerpc' options; `-mcpu=603', `-mcpu=604', `-mcpu=403', and
  4544.      `-mcpu=powerpc' enable the `-mpowerpc' option and disable the
  4545.      `-mpower' option; `-mcpu=common' disables both the `-mpower' and
  4546.      `-mpowerpc' options.
  4547.  
  4548.      To generate code that will operate on all members of the RS/6000
  4549.      and PowerPC families, specify `-mcpu=common'.  In that case, GNU
  4550.      Pascal will use only the instructions in the common subset of both
  4551.      architectures plus some special AIX common-mode calls, and will
  4552.      not use the MQ register.  GNU Pascal assumes a generic processor
  4553.      model for scheduling purposes.
  4554.  
  4555.      Specifying `-mcpu=rios1', `-mcpu=rios2', `-mcpu=rsc', or
  4556.      `-mcpu=power' also disables the `new-mnemonics' option.
  4557.      Specifying `-mcpu=601', `-mcpu=603', `-mcpu=604', `403', or
  4558.      `-mcpu=powerpc' also enables the `new-mnemonics' option.
  4559.  
  4560. `-mfull-toc'
  4561. `-mno-fp-in-toc'
  4562. `-mno-sum-in-toc'
  4563. `-mminimal-toc'
  4564.      Modify generation of the TOC (Table Of Contents), which is created
  4565.      for every executable file.  The `-mfull-toc' option is selected by
  4566.      default.  In that case, GNU Pascal will allocate at least one TOC
  4567.      entry for each unique non-automatic variable reference in your
  4568.      program.  GNU Pascal will also place floating-point constants in
  4569.      the TOC.  However, only 16,384 entries are available in the TOC.
  4570.  
  4571.      If you receive a linker error message that saying you have
  4572.      overflowed the available TOC space, you can reduce the amount of
  4573.      TOC space used with the `-mno-fp-in-toc' and `-mno-sum-in-toc'
  4574.      options.  `-mno-fp-in-toc' prevents GNU Pascal from putting
  4575.      floating-point constants in the TOC and `-mno-sum-in-toc' forces
  4576.      GNU Pascal to generate code to calculate the sum of an address and
  4577.      a constant at run-time instead of putting that sum into the TOC.
  4578.      You may specify one or both of these options.  Each causes GNU
  4579.      Pascal to produce very slightly slower and larger code at the
  4580.      expense of conserving TOC space.
  4581.  
  4582.      If you still run out of space in the TOC even when you specify
  4583.      both of these options, specify `-mminimal-toc' instead.  This
  4584.      option causes GNU Pascal to make only one TOC entry for every
  4585.      file.  When you specify this option, GNU Pascal will produce code
  4586.      that is slower and larger but which uses extremely little TOC
  4587.      space.  You may wish to use this option only on files that contain
  4588.      less frequently executed code.
  4589.  
  4590. `-msoft-float'
  4591. `-mhard-float'
  4592.      Generate code that does not use (uses) the floating-point register
  4593.      set.  Software floating point emulation is provided if you use the
  4594.      `-msoft-float' option, and pass the option to GNU Pascal when
  4595.      linking.
  4596.  
  4597. `-mmultiple'
  4598. `-mno-multiple'
  4599.      Generate code that uses (does not use) the load multiple word
  4600.      instructions and the store multiple word instructions.  These
  4601.      instructions are generated by default on POWER systems, and not
  4602.      generated on PowerPC systems.  Do not use `-mmultiple' on little
  4603.      endian PowerPC systems, since those instructions do not work when
  4604.      the processor is in little endian mode.
  4605.  
  4606. `-mstring'
  4607. `-mno-string'
  4608.      Generate code that uses (does not use) the load string
  4609.      instructions and the store string word instructions to save
  4610.      multiple registers and do small block moves.  These instructions
  4611.      are generated by default on POWER systems, anod not generated on
  4612.      PowerPC systems.  Do not use `-mstring' on little endian PowerPC
  4613.      systems, since those instructions do not work when the processor
  4614.      is in little endian mode.
  4615.  
  4616. `-mno-bit-align'
  4617. `-mbit-align'
  4618.      On System V.4 and embedded PowerPC systems do not (do) force
  4619.      structures and unions that contain bit fields to be aligned to the
  4620.      base type of the bit field.
  4621.  
  4622.      For example, by default a structure containing nothing but 8
  4623.      `unsigned' bitfields of length 1 would be aligned to a 4 byte
  4624.      boundary and have a size of 4 bytes.  By using `-mno-bit-align',
  4625.      the structure would be aligned to a 1 byte boundary and be one
  4626.      byte in size.
  4627.  
  4628. `-mno-strict-align'
  4629. `-mstrict-align'
  4630.      On System V.4 and embedded PowerPC systems do not (do) assume that
  4631.      unaligned memory references will be handled by the system.
  4632.  
  4633. `-mrelocatable'
  4634. `-mno-relocatable'
  4635.      On embedded PowerPC systems generate code that allows (does not
  4636.      allow) the program to be relocated to a different address at
  4637.      runtime.
  4638.  
  4639. `-mno-toc'
  4640. `-mtoc'
  4641.      On System V.4 and embedded PowerPC systems do not (do) assume that
  4642.      register 2 contains a pointer to a global area pointing to the
  4643.      addresses used in the program.
  4644.  
  4645. `-mno-traceback'
  4646. `-mtraceback'
  4647.      On embedded PowerPC systems do not (do) generate a traceback tag
  4648.      before the start of the function.  This tag can be used by the
  4649.      debugger to identify where the start of a function is.
  4650.  
  4651. `-mlittle'
  4652. `-mlittle-endian'
  4653.      On System V.4 and embedded PowerPC systems compile code for the
  4654.      processor in little endian mode.  The `-mlittle-endian' option is
  4655.      the same as `-mlittle'.
  4656.  
  4657. `-mbig'
  4658. `-mbig-endian'
  4659.      On System V.4 and embedded PowerPC systems compile code for the
  4660.      processor in big endian mode.  The `-mbig-endian' option is the
  4661.      same as `-mbig'.
  4662.  
  4663. `-mcall-sysv'
  4664.      On System V.4 and embedded PowerPC systems compile code using
  4665.      calling conventions that adheres to the March 1995 draft of the
  4666.      System V Application Binary Interface, PowerPC processor
  4667.      supplement.  This is the default unless you configured GPC using
  4668.      `powerpc-*-eabiaix'.
  4669.  
  4670. `-mcall-aix'
  4671.      On System V.4 and embedded PowerPC systems compile code using
  4672.      calling conventions that are similar to those used on AIX.  This
  4673.      is the default if you configured GPC using `powerpc-*-eabiaix'.
  4674.  
  4675. `-mprototype'
  4676. `-mno-prototype'
  4677.      On System V.4 and embedded PowerPC systems assume that all calls to
  4678.      variable argument functions are properly prototyped.  Otherwise,
  4679.      the compiler must insert an instruction before every non
  4680.      prototyped call to set or clear bit 6 of the condition code
  4681.      register (CR) to indicate whether floating point values were
  4682.      passed in the floating point registers in case the function takes
  4683.      a variable arguments.  With `-mprototype', only calls to
  4684.      prototyped variable argument functions will set or clear the bit.
  4685.  
  4686. 
  4687. File: ^.!gcc.docs.pascal.gpc,  Node: RT Options,  Next: MIPS Options,  Prev: RS/6000 and PowerPC Options,  Up: Submodel Options
  4688.  
  4689. IBM RT Options
  4690. --------------
  4691.  
  4692.    These `-m' options are defined for the IBM RT PC:
  4693.  
  4694. `-min-line-mul'
  4695.      Use an in-line code sequence for integer multiplies.  This is the
  4696.      default.
  4697.  
  4698. `-mcall-lib-mul'
  4699.      Call `lmul$$' for integer multiples.
  4700.  
  4701. `-mfull-fp-blocks'
  4702.      Generate full-size floating point data blocks, including the
  4703.      minimum amount of scratch space recommended by IBM.  This is the
  4704.      default.
  4705.  
  4706. `-mminimum-fp-blocks'
  4707.      Do not include extra scratch space in floating point data blocks.
  4708.      This results in smaller code, but slower execution, since scratch
  4709.      space must be allocated dynamically.
  4710.  
  4711. `-mfp-arg-in-fpregs'
  4712.      Use a calling sequence incompatible with the IBM calling
  4713.      convention in which floating point arguments are passed in
  4714.      floating point registers.  Note that `varargs.h' and `stdargs.h'
  4715.      will not work with floating point operands if this option is
  4716.      specified.
  4717.  
  4718. `-mfp-arg-in-gregs'
  4719.      Use the normal calling convention for floating point arguments.
  4720.      This is the default.
  4721.  
  4722. `-mhc-struct-return'
  4723.      Return structures of more than one word in memory, rather than in a
  4724.      register.  This provides compatibility with the MetaWare HighC (hc)
  4725.      compiler.  Use the option `-fpcc-struct-return' for compatibility
  4726.      with the Portable C Compiler (pcc).
  4727.  
  4728. `-mnohc-struct-return'
  4729.      Return some structures of more than one word in registers, when
  4730.      convenient.  This is the default.  For compatibility with the
  4731.      IBM-supplied compilers, use the option `-fpcc-struct-return' or the
  4732.      option `-mhc-struct-return'.
  4733.  
  4734. 
  4735. File: ^.!gcc.docs.pascal.gpc,  Node: MIPS Options,  Next: i386 Options,  Prev: RT Options,  Up: Submodel Options
  4736.  
  4737. MIPS Options
  4738. ------------
  4739.  
  4740.    These `-m' options are defined for the MIPS family of computers:
  4741.  
  4742. `-mcpu=CPU TYPE'
  4743.      Assume the defaults for the machine type CPU TYPE when scheduling
  4744.      instructions.  The choices for CPU TYPE are `r2000', `r3000',
  4745.      `r4000', `r4400', `r4600', and `r6000'.  While picking a specific
  4746.      CPU TYPE will schedule things appropriately for that particular
  4747.      chip, the compiler will not generate any code that does not meet
  4748.      level 1 of the MIPS ISA (instruction set architecture) without the
  4749.      `-mips2' or `-mips3' switches being used.
  4750.  
  4751. `-mips1'
  4752.      Issue instructions from level 1 of the MIPS ISA.  This is the
  4753.      default.  `r3000' is the default CPU TYPE at this ISA level.
  4754.  
  4755. `-mips2'
  4756.      Issue instructions from level 2 of the MIPS ISA (branch likely,
  4757.      square root instructions).  `r6000' is the default CPU TYPE at this
  4758.      ISA level.
  4759.  
  4760. `-mips3'
  4761.      Issue instructions from level 3 of the MIPS ISA (64 bit
  4762.      instructions).  `r4000' is the default CPU TYPE at this ISA level.
  4763.      This option does not change the sizes of any of the Pascal data
  4764.      types.
  4765.  
  4766. `-mfp32'
  4767.      Assume that 32 32-bit floating point registers are available.
  4768.      This is the default.
  4769.  
  4770. `-mfp64'
  4771.      Assume that 32 64-bit floating point registers are available.
  4772.      This is the default when the `-mips3' option is used.
  4773.  
  4774. `-mgp32'
  4775.      Assume that 32 32-bit general purpose registers are available.
  4776.      This is the default.
  4777.  
  4778. `-mgp64'
  4779.      Assume that 32 64-bit general purpose registers are available.
  4780.      This is the default when the `-mips3' option is used.
  4781.  
  4782. `-mint64'
  4783.      Types long, int, and pointer are 64 bits.  This works only if
  4784.      `-mips3' is also specified.
  4785.  
  4786. `-mlong64'
  4787.      Types long and pointer are 64 bits, and type int is 32 bits.  This
  4788.      works only if `-mips3' is also specified.
  4789.  
  4790. `-mmips-as'
  4791.      Generate code for the MIPS assembler, and invoke `mips-tfile' to
  4792.      add normal debug information.  This is the default for all
  4793.      platforms except for the OSF/1 reference platform, using the
  4794.      OSF/rose object format.  If the either of the `-gstabs' or
  4795.      `-gstabs+' switches are used, the `mips-tfile' program will
  4796.      encapsulate the stabs within MIPS ECOFF.
  4797.  
  4798. `-mgas'
  4799.      Generate code for the GNU assembler.  This is the default on the
  4800.      OSF/1 reference platform, using the OSF/rose object format.
  4801.  
  4802. `-mrnames'
  4803. `-mno-rnames'
  4804.      The `-mrnames' switch says to output code using the MIPS software
  4805.      names for the registers, instead of the hardware names (ie, A0
  4806.      instead of $4).  The only known assembler that supports this option
  4807.      is the Algorithmics assembler.
  4808.  
  4809. `-mgpopt'
  4810. `-mno-gpopt'
  4811.      The `-mgpopt' switch says to write all of the data declarations
  4812.      before the instructions in the text section, this allows the MIPS
  4813.      assembler to generate one word memory references instead of using
  4814.      two words for short global or static data items.  This is on by
  4815.      default if optimization is selected.
  4816.  
  4817. `-mstats'
  4818. `-mno-stats'
  4819.      For each non-inline function processed, the `-mstats' switch
  4820.      causes the compiler to emit one line to the standard error file to
  4821.      print statistics about the program (number of registers saved,
  4822.      stack size, etc.).
  4823.  
  4824. `-mmemcpy'
  4825. `-mno-memcpy'
  4826.      The `-mmemcpy' switch makes all block moves call the appropriate
  4827.      string function (`memcpy' or `bcopy') instead of possibly
  4828.      generating inline code.
  4829.  
  4830. `-mmips-tfile'
  4831. `-mno-mips-tfile'
  4832.      The `-mno-mips-tfile' switch causes the compiler not postprocess
  4833.      the object file with the `mips-tfile' program, after the MIPS
  4834.      assembler has generated it to add debug support.  If `mips-tfile'
  4835.      is not run, then no local variables will be available to the
  4836.      debugger.  In addition, `stage2' and `stage3' objects will have
  4837.      the temporary file names passed to the assembler embedded in the
  4838.      object file, which means the objects will not compare the same.
  4839.      The `-mno-mips-tfile' switch should only be used when there are
  4840.      bugs in the `mips-tfile' program that prevents compilation.
  4841.  
  4842. `-msoft-float'
  4843.      Generate output containing library calls for floating point.
  4844.      *Warning:* the requisite libraries are not part of GNU Pascal.
  4845.      Normally the facilities of the machine's usual C compiler are
  4846.      used, but this can't be done directly in cross-compilation.  You
  4847.      must make your own arrangements to provide suitable library
  4848.      functions for cross-compilation.
  4849.  
  4850. `-mhard-float'
  4851.      Generate output containing floating point instructions.  This is
  4852.      the default if you use the unmodified sources.
  4853.  
  4854. `-mabicalls'
  4855. `-mno-abicalls'
  4856.      Emit (or do not emit) the pseudo operations `.abicalls',
  4857.      `.cpload', and `.cprestore' that some System V.4 ports use for
  4858.      position independent code.
  4859.  
  4860. `-mlong-calls'
  4861. `-mno-long-calls'
  4862.      Do all calls with the `JALR' instruction, which requires loading
  4863.      up a function's address into a register before the call.  You need
  4864.      to use this switch, if you call outside of the current 512
  4865.      megabyte segment to functions that are not through pointers.
  4866.  
  4867. `-mhalf-pic'
  4868. `-mno-half-pic'
  4869.      Put pointers to extern references into the data section and load
  4870.      them up, rather than put the references in the text section.
  4871.  
  4872. `-membedded-pic'
  4873. `-mno-embedded-pic'
  4874.      Generate PIC code suitable for some embedded systems.  All calls
  4875.      are made using PC relative address, and all data is addressed
  4876.      using the $gp register.  This requires GNU as and GNU ld which do
  4877.      most of the work.
  4878.  
  4879. `-membedded-data'
  4880. `-mno-embedded-data'
  4881.      Allocate variables to the read-only data section first if
  4882.      possible, then next in the small data section if possible,
  4883.      otherwise in data.  This gives slightly slower code than the
  4884.      default, but reduces the amount of RAM required when executing,
  4885.      and thus may be preferred for some embedded systems.
  4886.  
  4887. `-msingle-float'
  4888. `-mdouble-float'
  4889.      The `-msingle-float' switch tells gcc to assume that the floating
  4890.      point coprocessor only supports single precision operations, as on
  4891.      the `r4650' chip.  The `-mdouble-float' switch permits gcc to use
  4892.      double precision operations.  This is the default.
  4893.  
  4894. `-mmad'
  4895. `-mno-mad'
  4896.      Permit use of the `mad', `madu' and `mul' instructions, as on the
  4897.      `r4650' chip.
  4898.  
  4899. `-m4650'
  4900.      Turns on `-msingle-float', `-mmad', and, at least for now,
  4901.      `-mcpu=r4650'.
  4902.  
  4903. `-EL'
  4904.      Compile code for the processor in little endian mode.  The
  4905.      requisite libraries are assumed to exist.
  4906.  
  4907. `-EB'
  4908.      Compile code for the processor in big endian mode.  The requisite
  4909.      libraries are assumed to exist.
  4910.  
  4911. `-G NUM'
  4912.      Put global and static items less than or equal to NUM bytes into
  4913.      the small data or bss sections instead of the normal data or bss
  4914.      section.  This allows the assembler to emit one word memory
  4915.      reference instructions based on the global pointer (GP or $28),
  4916.      instead of the normal two words used.  By default, NUM is 8 when
  4917.      the MIPS assembler is used, and 0 when the GNU assembler is used.
  4918.      The `-G NUM' switch is also passed to the assembler and linker.
  4919.      All modules should be compiled with the same `-G NUM' value.
  4920.  
  4921. `-nocpp'
  4922.      Tell the MIPS assembler to not run it's preprocessor over user
  4923.      assembler files (with a `.s' suffix) when assembling them.
  4924.  
  4925. 
  4926. File: ^.!gcc.docs.pascal.gpc,  Node: i386 Options,  Next: HPPA Options,  Prev: MIPS Options,  Up: Submodel Options
  4927.  
  4928. Intel 386 Options
  4929. -----------------
  4930.  
  4931.    These `-m' options are defined for the i386 family of computers:
  4932.  
  4933. `-m486'
  4934. `-m386'
  4935.      Control whether or not code is optimized for a 486 instead of an
  4936.      386.  Code generated for an 486 will run on a 386 and vice versa.
  4937.  
  4938. `-mieee-fp'
  4939. `-mno-ieee-fp'
  4940.      Control whether or not the compiler uses IEEE floating point
  4941.      comparisons.  These handle correctly the case where the result of a
  4942.      comparison is unordered.
  4943.  
  4944. `-msoft-float'
  4945.      Generate output containing library calls for floating point.
  4946.      *Warning:* the requisite libraries are not part of GNU Pascal.
  4947.      Normally the facilities of the machine's usual C compiler are
  4948.      used, but this can't be done directly in cross-compilation.  You
  4949.      must make your own arrangements to provide suitable library
  4950.      functions for cross-compilation.
  4951.  
  4952.      On machines where a function returns floating point results in the
  4953.      80387 register stack, some floating point opcodes may be emitted
  4954.      even if `-msoft-float' is used.
  4955.  
  4956. `-mno-fp-ret-in-387'
  4957.      Do not use the FPU registers for return values of functions.
  4958.  
  4959.      The usual calling convention has functions return values of types
  4960.      `float' and `double' in an FPU register, even if there is no FPU.
  4961.      The idea is that the operating system should emulate an FPU.
  4962.  
  4963.      The option `-mno-fp-ret-in-387' causes such values to be returned
  4964.      in ordinary CPU registers instead.
  4965.  
  4966. `-mno-fancy-math-387'
  4967.      Some 387 emulators do not support the `sin', `cos' and `sqrt'
  4968.      instructions for the 387.  Specify this option to avoid generating
  4969.      those instructions. This option is the default on FreeBSD.  As of
  4970.      revision 2.6.1, these instructions are not generated unless you
  4971.      also use the `-ffast-math' switch.
  4972.  
  4973. `-malign-double'
  4974. `-mno-align-double'
  4975.      Control whether GNU Pascal aligns `double', `long double', and
  4976.      `long long' variables on a two word boundary or a one word
  4977.      boundary.  Aligning `double' variables on a two word boundary will
  4978.      produce code that runs somewhat faster on a `Pentium' at the
  4979.      expense of more memory.
  4980.  
  4981.      *Warning:* if you use the `-malign-double' switch, structures
  4982.      containing the above types will be aligned differently than the
  4983.      published application binary interface specifications for the 386.
  4984.  
  4985. `-msvr3-shlib'
  4986. `-mno-svr3-shlib'
  4987.      Control whether GNU Pascal places uninitialized locals into `bss'
  4988.      or `data'.  `-msvr3-shlib' places these locals into `bss'.  These
  4989.      options are meaningful only on System V Release 3.
  4990.  
  4991. `-mno-wide-multiply'
  4992. `-mwide-multiply'
  4993.      Control whether GNU Pascal uses the `mul' and `imul' that produce
  4994.      64 bit results in `eax:edx' from 32 bit operands to do `long long'
  4995.      multiplies and 32-bit division by constants.
  4996.  
  4997. `-mrtd'
  4998.      Use a different function-calling convention, in which functions
  4999.      that take a fixed number of arguments return with the `ret' NUM
  5000.      instruction, which pops their arguments while returning.  This
  5001.      saves one instruction in the caller since there is no need to pop
  5002.      the arguments there.
  5003.  
  5004.      You can specify that an individual function is called with this
  5005.      calling sequence with the function attribute `stdcall'.  You can
  5006.      also override the `-mrtd' option by using the function attribute
  5007.      `cdecl'.
  5008.  
  5009.      *Warning:* this calling convention is incompatible with the one
  5010.      normally used on Unix, so you cannot use it if you need to call
  5011.      libraries compiled with the Unix compiler.
  5012.  
  5013.      Also, you must provide function prototypes for all functions that
  5014.      take variable numbers of arguments (including `printf'); otherwise
  5015.      incorrect code will be generated for calls to those functions.
  5016.  
  5017.      In addition, seriously incorrect code will result if you call a
  5018.      function with too many arguments.  (Normally, extra arguments are
  5019.      harmlessly ignored.)
  5020.  
  5021. `-mreg-alloc=REGS'
  5022.      Control the default allocation order of integer registers.  The
  5023.      string REGS is a series of letters specifying a register.  The
  5024.      supported letters are: `a' allocate EAX; `b' allocate EBX; `c'
  5025.      allocate ECX; `d' allocate EDX; `S' allocate ESI; `D' allocate
  5026.      EDI; `B' allocate EBP.
  5027.  
  5028. `-mregparm=NUM'
  5029.      Control how many registers are used to pass integer arguments.  By
  5030.      default, no registers are used to pass arguments, and at most 3
  5031.      registers can be used.  You can control this behavior for a
  5032.      specific function by using the function attribute `regparm'.
  5033.  
  5034.      *Warning:* if you use this switch, and NUM is nonzero, then you
  5035.      must build all modules with the same value, including any
  5036.      libraries.  This includes the system libraries and startup modules.
  5037.  
  5038. `-malign-loops=NUM'
  5039.      Align loops to a 2 raised to a NUM byte boundary.  If
  5040.      `-malign-loops' is not specified, the default is 2.
  5041.  
  5042. `-malign-jumps=NUM'
  5043.      Align instructions that are only jumped to to a 2 raised to a NUM
  5044.      byte boundary.  If `-malign-jumps' is not specified, the default is
  5045.      2 if optimizing for a 386, and 4 if optimizing for a 486.
  5046.  
  5047. `-malign-functions=NUM'
  5048.      Align the start of functions to a 2 raised to NUM byte boundary.
  5049.      If `-malign-jumps' is not specified, the default is 2 if optimizing
  5050.      for a 386, and 4 if optimizing for a 486.
  5051.  
  5052. 
  5053. File: ^.!gcc.docs.pascal.gpc,  Node: HPPA Options,  Next: Intel 960 Options,  Prev: i386 Options,  Up: Submodel Options
  5054.  
  5055. HPPA Options
  5056. ------------
  5057.  
  5058.    These `-m' options are defined for the HPPA family of computers:
  5059.  
  5060. `-mpa-risc-1-0'
  5061.      Generate code for a PA 1.0 processor.
  5062.  
  5063. `-mpa-risc-1-1'
  5064.      Generate code for a PA 1.1 processor.
  5065.  
  5066. `-mjump-in-delay'
  5067.      Fill delay slots of function calls with unconditional jump
  5068.      instructions by modifying the return pointer for the function call
  5069.      to be the target of the conditional jump.
  5070.  
  5071. `-mmillicode-long-calls'
  5072.      Generate code which assumes millicode routines can not be reached
  5073.      by the standard millicode call sequence, linker-generated
  5074.      long-calls, or linker-modified millicode calls.  In practice this
  5075.      should only be needed for dynamicly linked executables with
  5076.      extremely large SHLIB_INFO sections.
  5077.  
  5078. `-mdisable-fpregs'
  5079.      Prevent floating point registers from being used in any manner.
  5080.      This is necessary for compiling kernels which perform lazy context
  5081.      switching of floating point registers.  If you use this option and
  5082.      attempt to perform floating point operations, the compiler will
  5083.      abort.
  5084.  
  5085. `-mdisable-indexing'
  5086.      Prevent the compiler from using indexing address modes.  This
  5087.      avoids some rather obscure problems when compiling MIG generated
  5088.      code under MACH.
  5089.  
  5090. `-mfast-indirect-calls'
  5091.      Generate code which performs faster indirect calls.  Such code is
  5092.      suitable for kernels and for static linking.  The fast indirect
  5093.      call code will fail miserably if it's part of a dynamically linked
  5094.      executable and in the presense of nested functions.
  5095.  
  5096. `-mportable-runtime'
  5097.      Use the portable calling conventions proposed by HP for ELF
  5098.      systems.
  5099.  
  5100. `-mgas'
  5101.      Enable the use of assembler directives only GAS understands.
  5102.  
  5103. `-mschedule=CPU TYPE'
  5104.      Schedule code according to the constraints for the machine type
  5105.      CPU TYPE.  The choices for CPU TYPE are `700' for 7N0 machines,
  5106.      `7100' for 7N5 machines, and `7100' for 7N2 machines.  `700' is
  5107.      the default for CPU TYPE.
  5108.  
  5109.      Note the `7100LC' scheduling information is incomplete and using
  5110.      `7100LC' often leads to bad schedules.  For now it's probably best
  5111.      to use `7100' instead of `7100LC' for the 7N2 machines.
  5112.  
  5113. `-msoft-float'
  5114.      Generate output containing library calls for floating point.
  5115.      *Warning:* the requisite libraries are not available for all HPPA
  5116.      targets.  Normally the facilities of the machine's usual C
  5117.      compiler are used, but this cannot be done directly in
  5118.      cross-compilation.  You must make your own arrangements to provide
  5119.      suitable library functions for cross-compilation.  The embedded
  5120.      target `hppa1.1-*-pro' does provide software floating point
  5121.      support.
  5122.  
  5123.      `-msoft-float' changes the calling convention in the output file;
  5124.      therefore, it is only useful if you compile *all* of a program with
  5125.      this option.  In particular, you need to compile `libgcc.a', the
  5126.      library that comes with GNU Pascal, with `-msoft-float' in order
  5127.      for this to work.
  5128.  
  5129. 
  5130. File: ^.!gcc.docs.pascal.gpc,  Node: Intel 960 Options,  Next: DEC Alpha Options,  Prev: HPPA Options,  Up: Submodel Options
  5131.  
  5132. Intel 960 Options
  5133. -----------------
  5134.  
  5135.    These `-m' options are defined for the Intel 960 implementations:
  5136.  
  5137. `-mCPU TYPE'
  5138.      Assume the defaults for the machine type CPU TYPE for some of the
  5139.      other options, including instruction scheduling, floating point
  5140.      support, and addressing modes.  The choices for CPU TYPE are `ka',
  5141.      `kb', `mc', `ca', `cf', `sa', and `sb'.  The default is `kb'.
  5142.  
  5143. `-mnumerics'
  5144. `-msoft-float'
  5145.      The `-mnumerics' option indicates that the processor does support
  5146.      floating-point instructions.  The `-msoft-float' option indicates
  5147.      that floating-point support should not be assumed.
  5148.  
  5149. `-mleaf-procedures'
  5150. `-mno-leaf-procedures'
  5151.      Do (or do not) attempt to alter leaf procedures to be callable
  5152.      with the `bal' instruction as well as `call'.  This will result in
  5153.      more efficient code for explicit calls when the `bal' instruction
  5154.      can be substituted by the assembler or linker, but less efficient
  5155.      code in other cases, such as calls via function pointers, or using
  5156.      a linker that doesn't support this optimization.
  5157.  
  5158. `-mtail-call'
  5159. `-mno-tail-call'
  5160.      Do (or do not) make additional attempts (beyond those of the
  5161.      machine-independent portions of the compiler) to optimize
  5162.      tail-recursive calls into branches.  You may not want to do this
  5163.      because the detection of cases where this is not valid is not
  5164.      totally complete.  The default is `-mno-tail-call'.
  5165.  
  5166. `-mcomplex-addr'
  5167. `-mno-complex-addr'
  5168.      Assume (or do not assume) that the use of a complex addressing
  5169.      mode is a win on this implementation of the i960.  Complex
  5170.      addressing modes may not be worthwhile on the K-series, but they
  5171.      definitely are on the C-series.  The default is currently
  5172.      `-mcomplex-addr' for all processors except the CB and CC.
  5173.  
  5174. `-mcode-align'
  5175. `-mno-code-align'
  5176.      Align code to 8-byte boundaries for faster fetching (or don't
  5177.      bother).  Currently turned on by default for C-series
  5178.      implementations only.
  5179.  
  5180. `-mic-compat'
  5181. `-mic2.0-compat'
  5182. `-mic3.0-compat'
  5183.      Enable compatibility with iC960 v2.0 or v3.0.
  5184.  
  5185. `-masm-compat'
  5186. `-mintel-asm'
  5187.      Enable compatibility with the iC960 assembler.
  5188.  
  5189. `-mstrict-align'
  5190. `-mno-strict-align'
  5191.      Do not permit (do permit) unaligned accesses.
  5192.  
  5193. `-mold-align'
  5194.      Enable structure-alignment compatibility with Intel's gcc release
  5195.      version 1.3 (based on gcc 1.37).  Currently this is buggy in that
  5196.      `#pragma align 1' is always assumed as well, and cannot be turned
  5197.      off.
  5198.  
  5199. 
  5200. File: ^.!gcc.docs.pascal.gpc,  Node: DEC Alpha Options,  Next: Clipper Options,  Prev: Intel 960 Options,  Up: Submodel Options
  5201.  
  5202. DEC Alpha Options
  5203. -----------------
  5204.  
  5205.    These `-m' options are defined for the DEC Alpha implementations:
  5206.  
  5207. `-mno-soft-float'
  5208. `-msoft-float'
  5209.      Use (do not use) the hardware floating-point instructions for
  5210.      floating-point operations.  When `-msoft-float' is specified,
  5211.      functions in `libgcc1.c' will be used to perform floating-point
  5212.      operations.  Unless they are replaced by routines that emulate the
  5213.      floating-point operations, or compiled in such a way as to call
  5214.      such emulations routines, these routines will issue floating-point
  5215.      operations.   If you are compiling for an Alpha without
  5216.      floating-point operations, you must ensure that the library is
  5217.      built so as not to call them.
  5218.  
  5219.      Note that Alpha implementations without floating-point operations
  5220.      are required to have floating-point registers.
  5221.  
  5222. `-mfp-reg'
  5223. `-mno-fp-regs'
  5224.      Generate code that uses (does not use) the floating-point register
  5225.      set.  `-mno-fp-regs' implies `-msoft-float'.  If the floating-point
  5226.      register set is not used, floating point operands are passed in
  5227.      integer registers as if they were integers and floating-point
  5228.      results are passed in $0 instead of $f0.  This is a non-standard
  5229.      calling sequence, so any function with a floating-point argument
  5230.      or return value called by code compiled with `-mno-fp-regs' must
  5231.      also be compiled with that option.
  5232.  
  5233.      A typical use of this option is building a kernel that does not
  5234.      use, and hence need not save and restore, any floating-point
  5235.      registers.
  5236.  
  5237. 
  5238. File: ^.!gcc.docs.pascal.gpc,  Node: Clipper Options,  Next: H8/300 Options,  Prev: DEC Alpha Options,  Up: Submodel Options
  5239.  
  5240. Clipper Options
  5241. ---------------
  5242.  
  5243.    These `-m' options are defined for the Clipper implementations:
  5244.  
  5245. `-mc300'
  5246.      Produce code for a C300 Clipper processor. This is the default.
  5247.  
  5248. `-mc400'
  5249.      Produce code for a C400 Clipper processor i.e. use floating point
  5250.      registers f8..f15.
  5251.  
  5252. 
  5253. File: ^.!gcc.docs.pascal.gpc,  Node: H8/300 Options,  Next: System V Options,  Prev: Clipper Options,  Up: Submodel Options
  5254.  
  5255. H8/300 Options
  5256. --------------
  5257.  
  5258.    These `-m' options are defined for the H8/300 implementations:
  5259.  
  5260. `-mrelax'
  5261.      Shorten some address references at link time, when possible; uses
  5262.      the linker option `-relax'.  *Note `ld' and the H8/300:
  5263.      (ld.info)H8/300, for a fuller description.
  5264.  
  5265. `-mh'
  5266.      Generate code for the H8/300H.
  5267.  
  5268. 
  5269. File: ^.!gcc.docs.pascal.gpc,  Node: System V Options,  Prev: H8/300 Options,  Up: Submodel Options
  5270.  
  5271. Options for System V
  5272. --------------------
  5273.  
  5274.    These additional options are available on System V Release 4 for
  5275. compatibility with other compilers on those systems:
  5276.  
  5277. `-Qy'
  5278.      Identify the versions of each tool used by the compiler, in a
  5279.      `.ident' assembler directive in the output.
  5280.  
  5281. `-Qn'
  5282.      Refrain from adding `.ident' directives to the output file (this is
  5283.      the default).
  5284.  
  5285. `-YP,DIRS'
  5286.      Search the directories DIRS, and no others, for libraries
  5287.      specified with `-l'.
  5288.  
  5289. `-Ym,DIR'
  5290.      Look in the directory DIR to find the M4 preprocessor.  The
  5291.      assembler uses this option.
  5292.  
  5293. 
  5294. File: ^.!gcc.docs.pascal.gpc,  Node: Environment Variables,  Prev: Submodel Options,  Up: Invoking GPC
  5295.  
  5296. Environment Variables Affecting GNU Pascal
  5297. ==========================================
  5298.  
  5299.    This section describes several environment variables that affect how
  5300. GNU CC operates.  They work by specifying directories or prefixes to use
  5301. when searching for various kinds of files.
  5302.  
  5303.    Note that you can also specify places to search using options such as
  5304. `-B', `-I' and `-L' (*note Directory Options::.).  These take
  5305. precedence over places specified using environment variables, which in
  5306. turn take precedence over those specified by the configuration of GNU
  5307. CC.
  5308.  
  5309. `TMPDIR'
  5310.      If `TMPDIR' is set, it specifies the directory to use for temporary
  5311.      files.  GNU Pascal uses temporary files to hold the output of one
  5312.      stage of compilation which is to be used as input to the next
  5313.      stage: for example, the output of the preprocessor, which is the
  5314.      input to the compiler proper.
  5315.  
  5316. `GPC_EXEC_PREFIX'
  5317.      If `GPC_EXEC_PREFIX' is set, it specifies a prefix to use in the
  5318.      names of the subprograms executed by the compiler.  No slash is
  5319.      added when this prefix is combined with the name of a subprogram,
  5320.      but you can specify a prefix that ends with a slash if you wish.
  5321.  
  5322.      If GNU Pascal cannot find the subprogram using the specified
  5323.      prefix, it tries looking in the usual places for the subprogram.
  5324.  
  5325.      The default value of `GPC_EXEC_PREFIX' is `PREFIX/lib/gcc-lib/'
  5326.      where PREFIX is the value of `prefix' when you ran the `configure'
  5327.      script.
  5328.  
  5329.      Other prefixes specified with `-B' take precedence over this
  5330.      prefix.
  5331.  
  5332.      This prefix is also used for finding files such as `crt0.o' that
  5333.      are used for linking.
  5334.  
  5335.      In addition, the prefix is used in an unusual way in finding the
  5336.      directories to search for header files.  For each of the standard
  5337.      directories whose name normally begins with
  5338.      `/usr/local/lib/gcc-lib' (more precisely, with the value of
  5339.      `GPC_INCLUDE_DIR'), GNU Pascal tries replacing that beginning with
  5340.      the specified prefix to produce an alternate directory name.
  5341.      Thus, with `-Bfoo/', GNU Pascal will search `foo/bar' where it
  5342.      would normally search `/usr/local/lib/bar'.  These alternate
  5343.      directories are searched first; the standard directories come next.
  5344.  
  5345. `COMPILER_PATH'
  5346.      The value of `COMPILER_PATH' is a colon-separated list of
  5347.      directories, much like `PATH'.  GNU Pascal tries the directories
  5348.      thus specified when searching for subprograms, if it can't find the
  5349.      subprograms using `GPC_EXEC_PREFIX'.
  5350.  
  5351. `LIBRARY_PATH'
  5352.      The value of `LIBRARY_PATH' is a colon-separated list of
  5353.      directories, much like `PATH'.  When configured as a native
  5354.      compiler, GNU Pascal tries the directories thus specified when
  5355.      searching for special linker files, if it can't find them using
  5356.      `GPC_EXEC_PREFIX'.  Linking using GNU Pascal also uses these
  5357.      directories when searching for ordinary libraries for the `-l'
  5358.      option (but directories specified with `-L' come first).
  5359.  
  5360. `C_INCLUDE_PATH'
  5361. `CPLUS_INCLUDE_PATH'
  5362. `OBJC_INCLUDE_PATH'
  5363.      These environment variables pertain to particular languages.  Each
  5364.      variable's value is a colon-separated list of directories, much
  5365.      like `PATH'.  When GNU Pascal searches for header files, it tries
  5366.      the directories listed in the variable for the language you are
  5367.      using, after the directories specified with `-I' but before the
  5368.      standard header file directories.
  5369.  
  5370. `DEPENDENCIES_OUTPUT'
  5371.      If this variable is set, its value specifies how to output
  5372.      dependencies for Make based on the header files processed by the
  5373.      compiler.  This output looks much like the output from the `-M'
  5374.      option (*note Preprocessor Options::.), but it goes to a separate
  5375.      file, and is in addition to the usual results of compilation.
  5376.  
  5377.      The value of `DEPENDENCIES_OUTPUT' can be just a file name, in
  5378.      which case the Make rules are written to that file, guessing the
  5379.      target name from the source file name.  Or the value can have the
  5380.      form `FILE TARGET', in which case the rules are written to file
  5381.      FILE using TARGET as the target name.
  5382.  
  5383. 
  5384. File: ^.!gcc.docs.pascal.gpc,  Node: Keywords,  Next: Built-in,  Prev: Invoking GPC,  Up: Top
  5385.  
  5386. Keywords and operators supported by GNU Pascal
  5387. **********************************************
  5388.  
  5389.    This chapter lists all keywords and operators understood by GNU
  5390. Pascal.
  5391.  
  5392. Keywords
  5393. ========
  5394.  
  5395.    By default, keywords can be redefined to make it possible that every
  5396. correct ISO 7185 program can be compiled.  However, you can use the
  5397. compiler switches `--pascal-standard', `--pascal-extended',
  5398. `--pascal-object', `--pascal-borland', and `--pascal-sc' to tell GPC
  5399. that keywords of a given standard must not to be redefined.
  5400.  
  5401.    The keywords are taken from the following standards:
  5402.  
  5403.    * ISO 7185 Standard Pascal (SP)
  5404.  
  5405.    * ISO 10206 Extended Pascal (EP)
  5406.  
  5407.    * ANSI draft Object Pascal (OP) *(not yet implemented)*
  5408.  
  5409.    * Borland Pascal 7.0 (BP)
  5410.  
  5411.    * Pascal-SC (PXSC, Pascal eXtensions for Scientific Calculations)
  5412.  
  5413.      Keyword         Pascal standard        Remarks
  5414.      --------------------------------------------------------------------------
  5415.      Absolute        Borland                overload variables
  5416.      Abstract        Object                 not implemented
  5417.      All             GNU                    EP "export foo = all" extension
  5418.      And             ISO Standard
  5419.      And_then        ISO Extended           short-circuit Boolean AND operator
  5420.      Array           ISO Standard
  5421.      Asm             Borland, GNU           GNU-style assembler
  5422.      Begin           ISO Standard
  5423.      Bindable        ISO Extended           external binding of files, etc.
  5424.      Case            ISO Standard
  5425.      Class           Object                 not implemented
  5426.      Const           ISO Standard
  5427.      Constructor     Object, Borland        only BP version implemented
  5428.      Destructor      Object, Borland        only BP version implemented
  5429.      Div             ISO Standard
  5430.      Do              ISO Standard
  5431.      Downto          ISO Standard
  5432.      Else            ISO Standard
  5433.      End             ISO Standard
  5434.      Export          ISO Extended           Module Interface export
  5435.      File            ISO Standard
  5436.      For             ISO Standard
  5437.      Function        ISO Standard
  5438.      Goto            ISO Standard
  5439.      If              ISO Standard
  5440.      Import          ISO Extended           Module Interface import
  5441.      Implementation  ISO Extended, Borland  Module (EP) or Unit (BP) Impl. part
  5442.      Inherited       Object, Borland        only BP version implemented
  5443.      In              ISO Standard
  5444.      Inline          Borland, GNU           only GNU inline functions implem.
  5445.      Interface       ISO Extended, Borland  Module (EP) or Unit (BP) Int. part
  5446.      Is              Object                 not implemented
  5447.      Label           ISO Standard
  5448.      Mod             ISO Standard
  5449.      Module          ISO Extended, PXSC     PXSC version only partially implem.
  5450.      Nil             ISO Standard
  5451.      Not             ISO Standard
  5452.      Object          Borland                BP 7.0 style class definition
  5453.      Of              ISO Standard
  5454.      Only            ISO Extended           import specification
  5455.      Operator        PXSC                   operator definition
  5456.      Or              ISO Standard
  5457.      Or_else         ISO Extended           short-circuit Boolean OR operator
  5458.      Otherwise       ISO Extended           default case label
  5459.      Packed          ISO Standard           does not yet pack
  5460.      Pow             ISO Extended           exponentiation op. (integer expon.)
  5461.      Procedure       ISO Standard
  5462.      Program         ISO Standard
  5463.      Property        Object                 not implemented
  5464.      Protected       ISO Extended           read-only formal parameters
  5465.      Qualified       ISO Extended           import specification
  5466.      Record          ISO Standard
  5467.      Repeat          ISO Standard
  5468.      Restricted      ISO Extended           type specification
  5469.      Set             ISO Standard
  5470.      Shl             Borland                left bit-shift operator
  5471.      Shr             Borland                right bit-shift operator
  5472.      Then            ISO Standard
  5473.      To              ISO Standard
  5474.      Type            ISO Standard
  5475.      Unit            Borland                Borland (or UCSD) style Modules
  5476.      Until           ISO Standard
  5477.      Uses            Borland                Borland (or UCSD) style import
  5478.      Value           ISO Extended           variable initializer
  5479.      Var             ISO Standard
  5480.      View            Object                 not implemented
  5481.      Virtual         Borland, Object        only Borland version implemented
  5482.      While           ISO Standard
  5483.      With            ISO Standard
  5484.      Xor             Borland                Boolean/bitwise exclusive OR op.
  5485.  
  5486. Operators
  5487. =========
  5488.  
  5489.    GNU Pascal operators, ordered by precedence.
  5490.  
  5491.    The PXSC operators `+<', `-<', etc. are not implemented into GNU
  5492. Pascal but may be defined by the user.  If you do so and meet the PXSC
  5493. requirements, please let us know.  The other real operators do *not*
  5494. meet PXSC requirements.
  5495.  
  5496.    The Object Pascal operator `IS' is not implemented.
  5497.  
  5498.      :=
  5499.      <    =    >    IN   <>   >=   <=
  5500.      +    -    OR   +<   -<   +>   ->
  5501.      *    /    DIV  MOD  AND  SHL  SHR  XOR  *<   /<   *>   />
  5502.      POW  **   IS
  5503.      NOT
  5504.  
  5505. 
  5506. File: ^.!gcc.docs.pascal.gpc,  Node: Built-in,  Next: Extensions,  Prev: Keywords,  Up: Top
  5507.  
  5508. Redefineable built-in identifiers
  5509. *********************************
  5510.  
  5511.    The following identifiers are built in into GNU Pascal but may be
  5512. redefined according to any supported Pascal standard.
  5513.  
  5514.      Maxint
  5515.      False
  5516.      True
  5517.      Input
  5518.      Output
  5519.      
  5520.      Rewrite
  5521.      Reset
  5522.      Put
  5523.      Get
  5524.      Write
  5525.      Read
  5526.      Writeln
  5527.      Readln
  5528.      Page
  5529.      New
  5530.      Dispose
  5531.      Abs
  5532.      Sqr
  5533.      Sin
  5534.      Cos
  5535.      Exp
  5536.      Ln
  5537.      Sqrt
  5538.      Arctan
  5539.      Trunc
  5540.      Round
  5541.      Pack
  5542.      Unpack
  5543.      Ord
  5544.      Chr
  5545.      Succ
  5546.      Pred
  5547.      Odd
  5548.      Eof
  5549.      Eoln
  5550.  
  5551.    Directives
  5552.  
  5553.      Asmname            Specify case-sensitive external name for Function
  5554.      C                  External name for Function shall be lowercase
  5555.      C_language         same as C
  5556.      Forward
  5557.      External           External Name of Function Has First Letter Uppercase
  5558.      Extern             same as External
  5559.  
  5560.    Extended Pascal required module interfaces
  5561.  
  5562.      Standardoutput
  5563.      Standardinput
  5564.  
  5565.    Object Pascal directive (not implemented)
  5566.  
  5567.      Override
  5568.  
  5569.    Extended Pascal required words
  5570.  
  5571.      Maxchar
  5572.      Maxreal
  5573.      Minreal
  5574.      Epsreal
  5575.  
  5576.    Extended Pascal required Procedures and Functions
  5577.  
  5578.      Gettimestamp
  5579.      Date
  5580.      Time
  5581.      Halt
  5582.      Extend
  5583.      Seekwrite
  5584.      Seekread
  5585.      Seekupdate
  5586.      Empty
  5587.      Update
  5588.      Position
  5589.      Lastposition
  5590.      Re
  5591.      Im
  5592.      Cmplx
  5593.      Card
  5594.      Arg
  5595.  
  5596.    Extended Pascal external binding
  5597.  
  5598.      Bind
  5599.      Unbind
  5600.      Binding
  5601.  
  5602.    Extended Pascal complex type functions
  5603.  
  5604.      Polar
  5605.  
  5606.    Extended Pascal String functions
  5607.  
  5608.      Readstr            Read from a string rather than a file
  5609.      Writestr           Write to a string rather than a file
  5610.      Length
  5611.      Index              Search in a string
  5612.      Substr             also `MyStr [ 1..5 ]'
  5613.      Trim
  5614.      Eq                 lexical string comparision
  5615.      Lt
  5616.      Gt
  5617.      Ne
  5618.      Le
  5619.      Ge
  5620.  
  5621.    Extended pascal required string schema type generator
  5622.  
  5623.      String
  5624.  
  5625.    Object pascal (not implemented)
  5626.  
  5627.      Copy
  5628.      Null
  5629.      Root
  5630.      Textwritable
  5631.      Self
  5632.  
  5633.    Borland Pascal
  5634.  
  5635.      GetMem             Allocate memory with given size in bytes
  5636.      FreeMem            Free memory allocated with GetMem
  5637.      Inc                Increment
  5638.      Dec                Decrement
  5639.  
  5640.    More exotic fruits and birds (GPC extensions)
  5641.  
  5642.      Static             C-sense storage class specifications
  5643.      __const__
  5644.      __external__
  5645.      __inline__
  5646.      __static__
  5647.      __volatile__
  5648.      __byte__           C-style type size modifiers
  5649.      __short__
  5650.      __long__
  5651.      __longlong__
  5652.      __unsigned__
  5653.      
  5654.      Asm                Inline assembly (GNU style)
  5655.      Alignof
  5656.      Break              C-style
  5657.      Continue
  5658.      Return
  5659.      Sizeof
  5660.      Max                for enumeral and real types
  5661.      Min
  5662.      
  5663.      Conjugate
  5664.      Mark
  5665.      Release
  5666.      
  5667.      Default            like `otherwise' in a `case' statement
  5668.      Others
  5669.      
  5670.      Close
  5671.      Definesize
  5672.  
  5673.    Standard Pascal data types
  5674.  
  5675.      Integer
  5676.      Real
  5677.      Boolean
  5678.      Char
  5679.      Text
  5680.  
  5681.    Extended Pascal complex type
  5682.  
  5683.      Complex
  5684.  
  5685.    GPC extensions: void type (two spellings)
  5686.  
  5687.      __void__
  5688.      Void
  5689.  
  5690.    GPC extension: C compatibility string type
  5691.  
  5692.      __cstring__
  5693.  
  5694.    Extended Pascal: TimeStamp and BindingType
  5695.  
  5696.      Timestamp
  5697.      Bindingtype
  5698.  
  5699. 
  5700. File: ^.!gcc.docs.pascal.gpc,  Node: Extensions,  Next: Extended Pascal,  Prev: Built-in,  Up: Top
  5701.  
  5702. GNU Pascal extensions
  5703. *********************
  5704.  
  5705. Extensions to ISO-7185 Pascal language
  5706. ======================================
  5707.  
  5708.    GPC contains a number of extensions to the ISO 7185 Pascal language.
  5709.  
  5710.    Most of these extensions are written so that they should conform
  5711. conform to the international standard ISO/IEC 10206 : 1991, Information
  5712. technology - Programming Languages - Extended Pascal.
  5713.  
  5714.    GPC is not yet fully compliant to the requirements of the Extended
  5715. Pascal language.
  5716.  
  5717.    The following Extended Pascal features are implemented:
  5718.    * I/O from/to strings
  5719.  
  5720.    * append file open mode: `extend(File)'
  5721.  
  5722.    * binding of external objects (GPC supports only binding of files)
  5723.  
  5724.    * complex dyadic operations `+,-,/,*' and monadic `-,+'
  5725.  
  5726.    * complex exponentiation operators (`POW' and `**')
  5727.  
  5728.    * complex functions (`sqr,arctan,sqrt,exp,ln,sin,cos')
  5729.  
  5730.    * complex number info with `re, im' and `arg' functions
  5731.  
  5732.    * complex numbers constructed by `cmplx' or `polar'
  5733.  
  5734.    * constant expressions
  5735.  
  5736.    * direct access I/O
  5737.  
  5738.    * exponentiation operators (`POW' and `**')
  5739.  
  5740.    * function result variable
  5741.  
  5742.    * functions returning structured types
  5743.  
  5744.    * generalized `Succ/Pred' (`val := succ (val, 5);')
  5745.  
  5746.    * `gettimestamp, date, time'
  5747.  
  5748.    * `halt' procedure
  5749.  
  5750.    * initial values to type declarations and/or variable declarations
  5751.  
  5752.    * local variable declarations may dynamically select the type and
  5753.      size
  5754.  
  5755.    * `maxchar/minreal/maxreal/epsreal' values.
  5756.  
  5757.    * modules are partially supported (@@incomplete, see below)
  5758.  
  5759.    * non-decimal numbers, base from 2 through 36: `base#number'
  5760.  
  5761.    * pointer and component access of structured return values
  5762.  
  5763.    * protected parameters
  5764.  
  5765.    * ranges and otherwise in case statements and variant records
  5766.  
  5767.    * read procedure can read strings from text files
  5768.  
  5769.    * relaxation of rules on number & order of declarations
  5770.  
  5771.    * required module interfaces `StandardInput' and `StandardOutput'
  5772.  
  5773.    * restricted types
  5774.  
  5775.    * set extensions (symmetric difference(`XOR') and `CARD')
  5776.  
  5777.    * short circuit logical operators (`AND_THEN, OR_ELSE')
  5778.  
  5779.    * standard numeric input (ISO 6093)
  5780.  
  5781.    * string and char values are compatible
  5782.  
  5783.    * string catenations with "`+'"
  5784.  
  5785.    * string comparisons with and without padding
  5786.  
  5787.    * string functions (`trim,substr,index,length')
  5788.  
  5789.    * string schema (variable length strings)
  5790.  
  5791.    * string schema discriminant 'Capacity' dynamically set with NEW
  5792.  
  5793.    * substring variables (`str[5..7] := 'foo';')
  5794.  
  5795.    * type inquiry
  5796.  
  5797.    * underscore in identifiers
  5798.  
  5799.    * zero fieldwidth output
  5800.  
  5801.    Gpc extensions *not* in Extended Pascal:
  5802.    * alphanumeric labels
  5803.  
  5804.    * assembler code inclusion with access to variables
  5805.  
  5806.    * character escapes in strings
  5807.  
  5808.    * close file (@@ `unbind(F)' also closes a bound file `F')
  5809.  
  5810.    * computed goto
  5811.  
  5812.    * function pointers
  5813.  
  5814.    * `halt' procedure may have a numeric exit status parameter
  5815.  
  5816.    * `mark/release'
  5817.  
  5818.    * optional file name in `reset/rewrite/extend' as a string
  5819.  
  5820.    * `return / break / continue' statements
  5821.  
  5822.    * simple "modules" in addition to the Extended Pascal modules.
  5823.  
  5824.    * `sizeof/alignof' functions
  5825.  
  5826.    * `string[ XX ]' works like `string(XX)' as a string schema type
  5827.      selector
  5828.  
  5829.    * storage qualifiers in variable declarations
  5830.  
  5831.    * synonyms for `otherwise': `others' and `default'
  5832.  
  5833.    * taking address of labels
  5834.  
  5835.    * taking address of objects
  5836.  
  5837.    * type casts
  5838.  
  5839.    * type qualifiers
  5840.  
  5841.    * module initializers can be run in user specified order
  5842.  
  5843.    * source file preprosessor
  5844.  
  5845. Extended Pascal features still missing from GPC
  5846. -----------------------------------------------
  5847.  
  5848.    * set member iteration (`FOR ch IN [ 'a'..'z','0'..'9' ] DO...')
  5849.  
  5850.    * set types with variable bounds
  5851.  
  5852.    * structured value constructors
  5853.  
  5854.    * general schema types & make `NEW' work with them
  5855.  
  5856.    * some features of the module interface missing
  5857.  
  5858.    * subrange lower bound as an expression   (this is *hard* to do with
  5859.      an LALR(1) parser in single pass!     GPC allows upper bound as an
  5860.      arbitrary expression;    lower bound must now be an identifier, a
  5861.      constant or a    variable name.)
  5862.  
  5863. I/O to text files:
  5864. ------------------
  5865.  
  5866.    GPC implements "lazy" text file I/O, i.e. do a `PUT' as soon as you
  5867. can and do `GET' as late as you can.
  5868.  
  5869.    This should avoid most of the problems sometimes considered to be
  5870. the most stupid feature of Pascal.
  5871.  
  5872.    When passing a file buffer as parameter the buffer is validated when
  5873. the parameter is passed.  @@ Perhaps it would be nice to hack it to be
  5874. validated when the VAR parameter is referenced...
  5875.  
  5876.    When any lazy file is `RESET', the file buffer state is set to
  5877. undefined. It is validated on the first reference to it.  Now this is
  5878. also true for terminal devices.
  5879.  
  5880. Variable length strings in GPC:
  5881. -------------------------------
  5882.  
  5883.    Extended Pascal has a "type selector" feature called schema types.
  5884.  
  5885.    GPC does not yet implement general schema types, but the `STRING
  5886. SCHEMA' is now implemented.
  5887.  
  5888.    (An example of a (unimplemented) schemata would be, e.g:
  5889.  
  5890.      Matrix (N,M: Positive_int) = array [ 1..N, 1..M ] of integer;
  5891.  
  5892.    Here the `M' and `N' are discriminant identifiers.)
  5893.  
  5894.    A `STRING SCHEMA' is the only predefined schema type in Extended
  5895. Pascal, with one required discriminant identifier "`Capacity'".
  5896.  
  5897.    The string schema type, if explicitely defined, could look like:
  5898.  
  5899.      TYPE string(capacity) = packed array [ 1..capacity ] of char;
  5900.  
  5901.    Internally GPC implements `STRING SCHEMA' as follows:
  5902.  
  5903.    The type representing the `SCHEMA TYPE' is a `RECORD_TYPE' node,
  5904. with the following fields:
  5905.  
  5906.      STRING  = RECORD
  5907.          Capacity : integer;
  5908.          length   : integer;
  5909.          string   : packed array [ 1..Capacity ] of char;
  5910.        END;
  5911.  
  5912.    The "`Capacity'" field may be directly referenced by user,
  5913.  
  5914.    "`length'" is referenced by a predefined string function
  5915. `LENGTH(str)' and contains the current string length.
  5916.  
  5917.    "`string'" contains the chars in the string.
  5918.  
  5919.    The "`string'" and "`length'" fields can not be directly referenced
  5920. by a user program.
  5921.  
  5922.    References to the schema discriminants are allowed, and the `WITH'
  5923. statement is also allowed, so one can say:
  5924.  
  5925.      var str : string (80);
  5926.      begin
  5927.         writeln (str.capacity),         (* writes 80 *)
  5928.      
  5929.         with str do
  5930.           writeln (capacity);           (* writes 80 *)
  5931.      end;
  5932.  
  5933.    When a new `SCHEMA_TYPE' is created, the discriminant identifier
  5934. fields need to be initialized. GPC initializes the new schema type
  5935. discriminant identifiers of every `VAR_DECL' node before it executes
  5936. any instructions of the procedure, function or program where the string
  5937. variable is declared.
  5938.  
  5939.    If new internal schema types are created (for conversion of
  5940. fixed-string or char type parameters to a string schema formal
  5941. parameter), the discriminant identifiers are initialized immediately.
  5942. The discriminant identifiers of `PARM_DECL' nodes are not initialized
  5943. separately, they get their values from the actual parameters.
  5944.  
  5945.    If a parameter is a `SCHEMA_NAME' (a schema with no discriminant
  5946. identifiers), a proto string schema is used as the type of the
  5947. parameter.
  5948.  
  5949.    * VAR-parameter: An actual parameter to a formal schema name must be
  5950.      of `STRING_SCHEMA' type. The type of the actual parameter is used
  5951.      instead of the proto schema for the formal parameter.
  5952.  
  5953.    * VALUE-parameter: An actual parameter to a schema name may be
  5954.      either a `STRING_SCHEMA' type, a fixed string type or a char type.
  5955.      If the actual parameter is a string schema type, that is used
  5956.      instead of the proto schema. If it is not a schema, a new variable
  5957.      length string `VAR_DECL' is created, the actual parameter is
  5958.      copied to the new variable and the "`capacity'" field is set to
  5959.      the length of the actual variable.
  5960.  
  5961.    Variable length string parameters look like:
  5962.  
  5963.      PROGRAM Zap (output);
  5964.      
  5965.      TYPE
  5966.         stype = string (10);
  5967.         sptr  = ^string;
  5968.      
  5969.      VAR
  5970.         str  : stype;
  5971.         str2 : string(100000);
  5972.         dstr : ^string;
  5973.         zstr : sptr;
  5974.         len  : integer value 256;
  5975.      
  5976.        (* "string" accepts any length of strings *)
  5977.        PROCEDURE foo(z: string);
  5978.      
  5979.        BEGIN
  5980.          writeln ('Capacity : ',z.capacity);
  5981.          writeln ('Length   : ',length (z));
  5982.          writeln ('Contents : ',z);
  5983.        END;
  5984.      
  5985.        (* Another way to use dynamic strings *)
  5986.        PROCEDURE bar(slen : integer);
  5987.      
  5988.        var
  5989.          lstring : string (slen);
  5990.          foostr  : type of lstring;
  5991.      
  5992.        BEGIN
  5993.          lstring := 'Hello World!';
  5994.          foo (lstring);
  5995.          foostr := 'Ent{ miksi juuri t{m{?';
  5996.          foo(foostr);
  5997.        END;
  5998.      
  5999.      BEGIN
  6000.        str   := 'KUKKUU';
  6001.        str2  := 'A longer string variable';
  6002.      
  6003.        new (dstr, 1000);     { Select the string Capacity with NEW }
  6004.        dstr^ := 'The max length of this is 1000 chars';
  6005.        new (zstr, len);
  6006.        zstr^ := 'This should fit here';
  6007.      
  6008.        foo(str);
  6009.        foo(str2);
  6010.        foo('This is a constant string');
  6011.        foo('R');             { A char parameter to string routine }
  6012.        foo('');              { An empty string }
  6013.        foo (dstr^);
  6014.        foo (zstr^);
  6015.        bar (10000);
  6016.      END. (* Zap *)
  6017.  
  6018.    In the above example, the required procedure `NEW' was used to
  6019. select the capacity of the strings. Procedure "`BAR'" also has a string
  6020. whose size depends of the parameter passed to it and another string
  6021. whose type will be the same than the type of the first string ("`type
  6022. of'" construct).
  6023.  
  6024.    All string and char types are compatible as long as the destination
  6025. string is long enough to hold the source in assignments. If the source
  6026. string is shorter than the destination, the destination is
  6027. automatically blank padded if the destination string is not of string
  6028. schema type.
  6029.  
  6030. String routine (mostly in library):
  6031. -----------------------------------
  6032.  
  6033.    `S1' and `S2' may be of string or char type.  `S' is of string type.
  6034.  
  6035. `WRITESTR (s, write-parameter-list)'
  6036. `READSTR (s, read-parameter-list)'
  6037.      Write to a string and read from a string.  The parameter lists are
  6038.      identical to write/read from `TEXT' files. The semantics is
  6039.      closely modeled after file I/O.
  6040.  
  6041. `INDEX(s1,s2)'
  6042.      If `S2' is empty, return 1 else if `S1' is empty return 0 else
  6043.      returns the position of `s2' in `s1' (an integer).
  6044.  
  6045. `LENGTH (s1)'
  6046.      Return the length of `S1' (an integer from `0..Capacity')
  6047.  
  6048. `TRIM (s1)'
  6049.      Returns a new string with spaces stripped of the end of `S'.
  6050.  
  6051. `SUBSTR (s1, i)'
  6052. `SUBSTR (s1, i, j)'
  6053.      If `J' is missing it is calculated as: `J := LENGTH (S1) - I + 1;'
  6054.      Return a new substring of `S1' that contains `J' characters
  6055.      starting from `I'.
  6056.  
  6057. `EQ (s1,s2)'
  6058. `NE (s1,s2)'
  6059. `LT (s1,s2)'
  6060. `LE (s1,s2)'
  6061. `GT (s1,s2)'
  6062. `GE (s1,s2)'
  6063.      Lexicographic comparisons of `S1' and `S2'. Returns boolean result.
  6064.      Strings are not padded with spaces.
  6065.  
  6066. `s1  = s2'
  6067. `s1 <> s2'
  6068. `s1  < s2'
  6069. `s1 <= s2'
  6070. `s1  > s2'
  6071. `s1 >= s2'
  6072.      Pascal string compare of `S1' and `S2'. Returns boolean result.
  6073.      Shorter string is blank padded to length of the longer one.
  6074.  
  6075. No name space pollution with extensions:
  6076. ----------------------------------------
  6077.  
  6078.    In GPC you are free to re-define everything that is not a reserved
  6079. word in ISO 7185 Pascal in your program.
  6080.  
  6081.    All Extended Pascal additional "reserved words" may be redefined, so
  6082. you do not have to modify your code for GPC if you have an identifier
  6083. like `RESTRICTED' or `VALUE' or some such.  @@ This violates Extended
  6084. Pascal standard.
  6085.  
  6086.    You may also redefine words like `INTEGER' and `CHAR' if you like.
  6087.  
  6088.    @@ NOTE: The *only* exception to the redefinition rule currently is
  6089. the word `INLINE' (to make routines inline compiled), because I added
  6090. it in front of `PROCEDURE' or `FUNCTION'.  But I think I will change
  6091. the syntax later and make `INLINE' a directive instead of a reserved
  6092. word.
  6093.  
  6094. Compile time switches:
  6095. ----------------------
  6096.  
  6097.    to get info of possible clashes of keywords and other info of your
  6098. program constructs that gpc thinks are "non-standard" use the switch
  6099. "`-pedantic'" when compiling. See the GCC info files.
  6100.  
  6101.    @@ I have not tested the switches like -Wall very much. If you do,
  6102. @@ give me info of error messages that don't make sense in Pascal.
  6103.  
  6104.    @@ As a rule, GPC implements most of the switches GCC implements,
  6105. and a couple of more that can not currently be set.
  6106.  
  6107. Implemented directives:
  6108. -----------------------
  6109.  
  6110. `FORWARD'
  6111.      Required by pascal standard.
  6112.  
  6113. `EXTERNAL'
  6114.      External routine which starts with a capital letter. (e.g. calling
  6115.      external function "`foo()'" will actually call "`Foo()'")
  6116.  
  6117. `EXTERN'
  6118.      Same as external
  6119.  
  6120. `C'
  6121.      Calls external routine "`foo()'" as "`foo()'" (no capitalization
  6122.      of the first letter)
  6123.  
  6124. `C_LANGUAGE'
  6125.      Same as C.
  6126.  
  6127. `STATIC'
  6128.      Make a function static in C sense.
  6129.  
  6130.      PROGRAM foo;
  6131.      
  6132.      PROCEDURE gotoxy(x,y: Integer); C;
  6133.      
  6134.      BEGIN
  6135.        gotoxy(10,10); (* Call external routine "gotoxy" *)
  6136.      END.
  6137.  
  6138. Set operations:
  6139. ---------------
  6140.  
  6141.    GPC supports standard Pascal set operations. In addition it supports
  6142. the extended Pascal set operation symmetric difference (`set1 >< set2')
  6143. operation (a `XOR' of the set elements).
  6144.  
  6145.    It also has a function that counts the elements in the set: `a :=
  6146. card (set1)'
  6147.  
  6148.    *NOTE*: the set operations are still under construction, e.g. the set
  6149. code does not fully work in the 64 bit Alpha machines.
  6150.  
  6151. Initial values to type denoters:
  6152. --------------------------------
  6153.  
  6154.    A type (or variable) may be initialized to a value of expression
  6155. when it is declared, as in:
  6156.  
  6157.      program zap;
  6158.      
  6159.      type
  6160.         int10   = integer value 10;
  6161.         footype = real;
  6162.         mytype  = char value pred('A');
  6163.         etype   = (a,b,c,d,e,f,g) value d;
  6164.      
  6165.      var
  6166.         ii  : int10;                     (* Value of ii set to 10 *)
  6167.         ch  : mytype  value pred('z');
  6168.         aa  : integer value ii+10;
  6169.         foo : footype value sqrt(aa);
  6170.         e1  : etype;                     (* value set to d *)
  6171.         e2  : etype value g;             (* value set to g *)
  6172.      
  6173.      begin
  6174.      end.
  6175.  
  6176.    Extended pascal requires the type initializers to be constant
  6177. expressions. GPC allows any valid expression.
  6178.  
  6179.    Note, however, that the expressions that affect the size of storage
  6180. allocated for objects (e.g. the length of arrays) may contain variables
  6181. only inside functions or procedures.
  6182.  
  6183.    GPC evaluates the initial values used for the type when an
  6184. identifier is declared for that type.  If a variable is declared with a
  6185. type-denoter that uses a type-name which already has an initial value
  6186. the latter initialization has precedence.
  6187.  
  6188.    @@ GPC does not know how to calculate constant values for math
  6189. functions in the runtime library at compile time, e.g.
  6190. `exp(sin(2.4567))', so you should not use these kind of expressions in
  6191. object size expressions. (Extended Pascal allows this).
  6192.  
  6193. Date and time routines:
  6194. -----------------------
  6195.  
  6196.    Predefined date and time routines:
  6197.  
  6198. `procedure gettimestamp(VAR t: Timestamp);'
  6199. `function date(t: Timestamp) : packed array [ 1..DATE_LENGTH ] of char;'
  6200. `function time(t: Timestamp) : packed array [ 1..TIME_LENGTH ] of char;'
  6201.    `DATE_LENGTH' and `TIME_LENGTH' are implementation dependent
  6202. constants. See E.20 and E.22 in chapter IMPLEMENTATION DEPENDENT
  6203. FEATURES to find out these values for GPC.
  6204.  
  6205.    `GetTimeStamp(t)' fills the record T with values. If they are valid,
  6206. the boolean flags are set to TRUE.
  6207.  
  6208.    `TimeStamp' is a required predefined type in extended pascal
  6209. standard.  (It may be extended in an implementation.)
  6210.  
  6211.    The required part of the type looks like:
  6212.      TimeStamp = PACKED RECORD
  6213.                   DateValid,
  6214.                   TimeValid : Boolean;
  6215.                   year      : integer;
  6216.                   month     : 1 .. 12;
  6217.                   day       : 1 .. 31;
  6218.                   hour      : 0 .. 23;
  6219.                   minute    : 0 .. 59;
  6220.                   second    : 0 .. 59;
  6221.                 END;
  6222.  
  6223.    @@ NOTE: `TimeStamp' may be later extended in GPC to contain the
  6224. following fields at the end of the `TimeStamp' record:
  6225.  
  6226.      Dst_used   : Boolean;     (* If daylight savings are used *)
  6227.      TimeZone   : Integer;     (* Positive if WEST, in minutes *)
  6228.      Weekday    : 0..6;        (* 0 is Sunday *)
  6229.      TimerValid : Boolean;     (* Is the following timer valid *)
  6230.      us_Timer   : Integer;     (* A microsecond timer that is a 32 bit
  6231.                                   modulus of the timer returned by the
  6232.                                   system. *)
  6233.  
  6234.    Fields `Dst_used, TimeZone' and `WeekDay' will be valid when
  6235. `DateValid' is `TRUE'. Field `us_Timer' will be valid when `TimerValid'
  6236. is `TRUE'.
  6237.  
  6238. Complex type and operations:
  6239. ----------------------------
  6240.  
  6241.    The following sample programs illustrates most of the `COMPLEX' type
  6242. operations. In addition monadic `+' and `-' are supported and dyadic
  6243. `+,-,*,/' operations.
  6244.  
  6245.      program complex_test(output);
  6246.      
  6247.      var
  6248.         z1,z2       : complex;
  6249.         len, angle  : real;
  6250.      
  6251.      begin
  6252.         z1 := cmplx (2,1);
  6253.         writeln;
  6254.         writeln ('Complex number Z1 is: (',re(z1):1,',',im(z1):1,')');
  6255.         writeln;
  6256.      
  6257.         z2 := conjugate(z1); { GPC extension }
  6258.         writeln ('Conjugate of Z1 is: (',re(z2):1,',',im(z2):1,')');
  6259.         writeln;
  6260.         len   := abs (z1);
  6261.         angle := arg (z1);
  6262.         writeln ('The polar representation of Z1 is LENGTH=',len:1,
  6263.                  ' ANGLE=',angle:1);
  6264.         writeln;
  6265.      
  6266.         z2    := polar (len, angle);
  6267.         writeln ('Converting (LENGTH,ANGLE) back to (X,Y) gives: (',
  6268.                   re(z2):1,',',im(z2):1,')');
  6269.         writeln;
  6270.         writeln ('The following operations operate on the complex number Z1');
  6271.         writeln;
  6272.      
  6273.         z2 := arctan (z1);
  6274.         writeln ('arctan:  R=',re(z2),', I=',im(z2));
  6275.      
  6276.         z2 := z1 ** 3.141;
  6277.         writeln ('**3.141: R=',re(z2),', I=',im(z2));
  6278.         { cos, ln, exp, sqrt and sqr exist also }
  6279.      
  6280.         z2 := sin(z1);
  6281.         writeln ('sin:     R=',re(z2),', I=',im(z2));
  6282.      
  6283.         z2 := z1 pow 8;
  6284.         writeln ('POW 8:   R=',re(z2),', I=',im(z2));
  6285.      
  6286.         z2 := z1 pow (-8);
  6287.         writeln ('POW (-8):  R=',re(z2),', I=',im(z2));
  6288.      end.
  6289.  
  6290. Direct access files:
  6291. --------------------
  6292.  
  6293.    @@ Not tested.  @@ Write a demo program.
  6294.  
  6295.      type
  6296.        Dfile = file [ 1 .. 100 ] of integer;
  6297.      var
  6298.        F : Dfile;
  6299.        P, N : 1..100;
  6300.  
  6301.    Declares a type for a file that contains 100 integers.
  6302.  
  6303.    The following direct access routines may be applied to a direct
  6304. access file:
  6305.  
  6306. `SeekRead   (F, N);        { Open file in Inspection mode, seek to record N }'
  6307. `SeekWrite  (F, N);        { Open file in Generation mode, seek to record N }'
  6308. `SeekUpdate (F, N);        { Open file in Update mode, seek to record N }'
  6309. `Update (F);               { Writes F^, position not changed. F^ kept. }'
  6310. `p := Position (F);        { Return current record number }'
  6311. `p := LastPosition (F);    { Return the last record number in file }'
  6312.    If the file is open for Inspection or Update, `GET' may be applied.
  6313. If the file is open for Generation or Update, `PUT' may be applied.
  6314.  
  6315.    @@ GPC acts like the file would always start at record number 0, and
  6316. subtracts/adds the lower index from the record number.  If you think
  6317. this is incorrect, let me know.
  6318.  
  6319. Restricted types:
  6320. -----------------
  6321.  
  6322.    Extended Pascal defines restricted types as:
  6323.  
  6324.      restricted-type = 'restricted' type-name .
  6325.  
  6326.    A value of a restricted type may be passed as a value parameter to a
  6327. formal parameter possessing its underlying type, or returned as the
  6328. result of a function. A variable of a restricted type may be passed as
  6329. a variable parameter to a formal parameter possessing the same type or
  6330. its underlying type. No other operations, such as accessing a component
  6331. of a restricted type value or performing arithmetic, are possible.
  6332.  
  6333.      program zap;
  6334.      
  6335.      type
  6336.         unres_rec =  record
  6337.                        a :  integer;
  6338.                      end;
  6339.      
  6340.         res =  restricted unres_rec;
  6341.      
  6342.      var
  6343.         r1 :  unres_rec;
  6344.         r2 :  res;
  6345.      
  6346.         i  :  restricted integer;
  6347.         k  :  integer;
  6348.      
  6349.        function zap(p : unres_rec) : res;
  6350.        var
  6351.           ures :  unres_rec;
  6352.      
  6353.        begin
  6354.           { The parameter is treated as unrestricted, even though the actual
  6355.             parameter may be a restricted object }
  6356.           ures.a := p.a;
  6357.      
  6358.           { Legal to assign a return value }
  6359.           zap := ures;
  6360.        end; { zap }
  6361.      
  6362.      begin
  6363.         r1.a := 354;
  6364.      
  6365.         { Assigning a restricted return value to a restricted object }
  6366.         { @@ Verify if this should really be allowed????? }
  6367.         r2 := zap(r1);
  6368.      
  6369.         { Passing a restricted object to unrestericted formal parameter is ok }
  6370.         r2 := zap(r2);
  6371.      
  6372.         { *** The following are illegal *** }
  6373.         r2.a := 100;        { field access }
  6374.         r1 := r2;        { := source is restricted type }
  6375.         r2 := r1;        { := target is restricted type }
  6376.         r1 := zap(r2);   { := a restricted return value to unrestricted object }
  6377.         i  := 16#ffff;   { := target is restricted type }
  6378.         k  := i + 2;     { Arithmetic with restricted type }
  6379.      end.
  6380.  
  6381. Extended Pascal modules:
  6382. ------------------------
  6383.  
  6384.    @@ Gpc does not yet support:
  6385.  
  6386.    * renaming with '`=>''
  6387.  
  6388.    * `QUALIFIED' interfaces
  6389.  
  6390.    * `PROTECTED' export variables
  6391.  
  6392.    * `ONLY'
  6393.  
  6394.    * `IMPORT' does not work semantically correct.
  6395.  
  6396.    * `EXPORT' does not work semantically correct.
  6397.  
  6398.    * exported ranges (compiler calls `abort()')
  6399.  
  6400.    * module parameter lists
  6401.  
  6402.    Gpc should be able to parse full Extended Pascal module syntax.  But
  6403. all the features are not implemented yet.
  6404.  
  6405.    You may load one PROGRAM and several MODULEs to make up one pascal
  6406. program. A single file may contain zero or more modules and/or zero or
  6407. one programs.
  6408.  
  6409.    *Please NOTE*: If you have many modules in the same file, the
  6410. variable and function declarations are visible after the point they
  6411. have been declared in the implementation even if the interface does not
  6412. export them. But they do not become visible only by including the
  6413. interface to another file and separate compiling that (so you do need
  6414. to export them now).  (@@ unfortunately, currently this applies only to
  6415. variables  and functions; all other things are visible after the
  6416. interface  has been compiled whether or not you exported them.)
  6417.  
  6418.    The nicest way to handle the module interface in separate
  6419. compilation environment is to use the non-standard
  6420.  
  6421.      #include "module-interface.ph"
  6422.  
  6423.    feature. You can collect your module interfaces to a single
  6424. directory and include them from there by using the "`-I DIR'" switches
  6425. to specify the include file search paths to the compiler. (See the GNU
  6426. CPP manual for more info).
  6427.  
  6428.    There is currently no attempt to avoid name clashes of separate
  6429. compiled modules when they are linked together.  (The exported
  6430. variables and functions having the same name  in different modules will
  6431. clash!!!)
  6432.  
  6433.    Sample module code with separate `INTERFACE' and `IMPLEMENTATION'
  6434. parts follows:
  6435.  
  6436.      MODULE foobar Interface;    (* INTERFACE *)
  6437.      
  6438.        EXPORT catch22 = (footype,setfoo,getfoo);
  6439.      
  6440.        TYPE footype = integer;
  6441.      
  6442.        PROCEDURE setfoo(f: footype);
  6443.        FUNCTION  getfoo: footype;
  6444.      
  6445.      END. { module foobar interface }
  6446.      
  6447.      
  6448.      MODULE foobar Implementation;    (* IMPLEMENTATION *)
  6449.      
  6450.        IMPORT StandardInput;
  6451.               StandardOutput;
  6452.      
  6453.        VAR foo : footype;
  6454.      
  6455.        { Note: the effect is the same as the Forward directive would have:
  6456.          parameter lists and return types are not "allowed" in the declaration
  6457.          of exported routines. }
  6458.        PROCEDURE setfoo;
  6459.        BEGIN
  6460.          foo := f;
  6461.        END;
  6462.      
  6463.        FUNCTION getfoo;
  6464.        BEGIN
  6465.          getfoo := foo;
  6466.        END;
  6467.      
  6468.        TO BEGIN DO
  6469.          BEGIN
  6470.            foo := 59;
  6471.            writeln ('Just an example of a module initializer. See comment below');
  6472.          END;
  6473.      
  6474.        TO END DO
  6475.         BEGIN
  6476.           foo := 0;
  6477.           writeln ('Goodbye');
  6478.         END;
  6479.      
  6480.      END. { foobar implementation }
  6481.  
  6482.    Alternatively the module interface and implementation may be
  6483. combined as follows:
  6484.  
  6485.      MODULE foobar;            (* ALTERNATIVE METHOD *)
  6486.      
  6487.        EXPORT catch22 = (footype,setfoo,getfoo);
  6488.      
  6489.        TYPE footype = integer;
  6490.      
  6491.        PROCEDURE setfoo(f: footype);
  6492.        FUNCTION getfoo: footype;
  6493.      
  6494.        END; { NOTE: this END is required here, even if the
  6495.               module-block below would be empty. }
  6496.      
  6497.        VAR foo : footype;
  6498.      
  6499.        PROCEDURE setfoo;
  6500.        BEGIN
  6501.          foo := f;
  6502.        END;
  6503.      
  6504.        FUNCTION getfoo;
  6505.        BEGIN
  6506.          getfoo := foo;
  6507.        END;
  6508.      
  6509.      END. { module foobar }
  6510.  
  6511.    Either one of the two methods may be used with:
  6512.  
  6513.      PROGRAM what(output);
  6514.      
  6515.      import catch22;
  6516.      
  6517.      BEGIN
  6518.        setfoo (999);
  6519.        writeln (getfoo);
  6520.      END.
  6521.  
  6522.    The `INTERFACE' has to be in the same file as the program/module that
  6523. uses it's exported names.  Otherwise GPC does not know anything about
  6524. it and fails to compile the file.
  6525.  
  6526. Somewhat simpler GPC modules are also supported:
  6527. ------------------------------------------------
  6528.  
  6529.    *Note*: this is not supported in Extended Pascal standard.
  6530.  
  6531.    This is a simpler module support that does not require exports,
  6532. imports, module headers etc.
  6533.  
  6534.    These non-standard simple Gpc modules look like (does not have an
  6535. export part, does not have a separate  module-block, does not use
  6536. import/export features.)
  6537.  
  6538.      MODULE foobar;
  6539.        TYPE footype = integer;
  6540.        VAR foo: footype;
  6541.      
  6542.        PROCEDURE setfoo(f: footype);
  6543.        BEGIN
  6544.          foo := f;
  6545.        END;
  6546.      
  6547.        FUNCTION getfoo: footype;
  6548.        BEGIN
  6549.          getfoo := foo;
  6550.        END;
  6551.      END.
  6552.      
  6553.      PROGRAM what(output);
  6554.      
  6555.        (* In case the module foobar is loaded from another file *)
  6556.        PROCEDURE setfoo(f: footype); External;
  6557.        FUNCTION  getfoo: footype;    External;
  6558.      
  6559.      BEGIN
  6560.        setfoo (999);
  6561.        writeln (getfoo);
  6562.      END.
  6563.  
  6564. Module initialization and finalization:
  6565. ---------------------------------------
  6566.  
  6567.    `TO BEGIN DO' module initialization and `TO END DO' module
  6568. finalization constructs are supported if the GNU compiler supports
  6569. constructors and destructors in your target machine. (It always does if
  6570. you use the GNU Linker).
  6571.  
  6572.    If the initialization and finalizations do not work by default, but
  6573. you have the GNU Linker, use option `-fgnu-linker' when compiling the
  6574. program.
  6575.  
  6576.    I re-implemeted the standard I/O handling and now the input and
  6577. output can also be used from the initialization and finalization parts.
  6578.  
  6579.    @@ Try these, send me bug reports. These are not tested.
  6580.  
  6581. Binding of objects to external names:
  6582. -------------------------------------
  6583.  
  6584.    GPC supports the extended pascal `bind,unbind' and `binding'
  6585. operations when applied to files.
  6586.  
  6587.    The compiler will currently reject binding of other object types (@@
  6588. Perhaps the run time system should do the rejection?)
  6589.  
  6590.    GPC implements extensions to the required predefined record type
  6591. BindingType:
  6592.  
  6593.      BindingType = PACKED_RECORD
  6594.                      Bound             : Boolean;
  6595.                      Extensions_Valid  : Boolean;
  6596.                      Writable          : Boolean;
  6597.                      Readable          : Boolean;
  6598.                      Existing          : Boolean;
  6599.                      Error             : Integer;    { Unused currently }
  6600.                      Size              : Integer;    { # of elements or -1 }
  6601.                      Name              : String (BINDING_NAME_LENGTH);
  6602.                    END;
  6603.  
  6604.    The fields `BOUND' and `NAME' are required by the standard. All
  6605. other fields are extensions.
  6606.  
  6607.    The meaning of the extensions to the `BindingType' record type, and
  6608. the value of `BINDING_NAME_LENGTH' is defined in this document, section
  6609. IMPLEMENTATION DEFINED FEATURES (E.14). It is a compiler constant, the
  6610. run time system accepts any length.
  6611.  
  6612.    The `Size' field is a latest addition to `BindingType;' I added that
  6613. because the direct access files actually require that the file is not
  6614. bigger that the definition; and `lastposition(file)' does not work
  6615. before the file is opened. The "`Size'" field can then be used to
  6616. determine the size before `open', and if the upper bound of the direct
  6617. access file is a variable one should be able to open files of any size
  6618. without violating the standard.
  6619.  
  6620.    The following is an example of the binding:
  6621.  
  6622.      program z(input,output,f);
  6623.      
  6624.      var
  6625.         f :  text;
  6626.      
  6627.      procedure bindfile (varf :  text);
  6628.      var
  6629.         b : BindingType;
  6630.      
  6631.      begin
  6632.        unbind (f);
  6633.        b := binding (f);
  6634.        repeat
  6635.          write ('Enter file name:');
  6636.          readln (b.name);
  6637.          bind (f, b);
  6638.          b := binding (f);
  6639.          if not b.bound then
  6640.            writeln ('File not bound--try again');
  6641.        until b.bound;
  6642.      end;
  6643.      
  6644.      begin
  6645.      
  6646.        bindfile (f);
  6647.      
  6648.        (* Now the file F is bound to an external file.
  6649.         *
  6650.         * You can use the implementation defined fields
  6651.         * to check if the file is Readable, Writable and
  6652.         * if it Exists. These are valid if the.Extensions_Valid
  6653.         * field is TRUE.
  6654.         *)
  6655.      end.
  6656.  
  6657. Function pointers:
  6658. ------------------
  6659.  
  6660.    GPC suports also function pointers and calls through them.  This is
  6661. a non-standard feature.
  6662.  
  6663.      program zap(output);
  6664.      
  6665.      type
  6666.          proc_ptr = ^ procedure (integer);
  6667.      
  6668.      var
  6669.          pvar : proc_ptr;
  6670.      
  6671.      procedure write_int(i: integer);
  6672.      begin
  6673.        writeln ('Integer: ',i:1);
  6674.      end;
  6675.      
  6676.      begin
  6677.        (* PVAR points to function WRITE_IT *)
  6678.        pvar := &write_int;
  6679.      
  6680.        (* Dereferencing a function pointer calls the function *)
  6681.        pvar^(12345);
  6682.      end.
  6683.  
  6684. String catenation:
  6685. ------------------
  6686.  
  6687.    Gpc supports string catenation with the '`+'' operator.  All
  6688. string-types are compatible, so you may catenate any chars, fixed
  6689. length strings and variable length strings with each other.
  6690.  
  6691.      program scat (input, output);
  6692.      
  6693.      var
  6694.         ch          : char;
  6695.         str         : string(100);
  6696.         str2           : string(50);
  6697.         fstr        : packed array [ 1 .. 20 ] of char;
  6698.      
  6699.      begin
  6700.         ch   := '$';
  6701.         fstr := 'demo';        { padded with blanks }
  6702.         write ('Give me some chars to play with: ');
  6703.         readln (str);
  6704.         str := '^' + 'prefix:' + str + ':suffix:' + fstr + ch;
  6705.         writeln ('Len' + 'gth = ', length (str));
  6706.         writeln (str);
  6707.      end.
  6708.  
  6709. Type qualifiers:
  6710. ----------------
  6711.  
  6712.    @ New feature.  @ Currently gpc runtime does not know anything about
  6713. these.  @ These may change/or get removed...
  6714.  
  6715.    As an extension, GPC allows you to use type qualifiers:
  6716. `__byte__'
  6717.      8 bit integer
  6718.  
  6719. `__short__'
  6720.      Short integer (16 bits) or real type (32 bits)
  6721.  
  6722. `__long__'
  6723.      Long integer or real type
  6724.  
  6725. `__longlong__'
  6726.      long long integer type (64 bits)
  6727.  
  6728. `__unsigned__'
  6729.      Unsigned INTEGER type
  6730.  
  6731.    The `__unsigned__' works for all integer types, also those that have
  6732. been previously declared with some other type qualifier, like
  6733. `__short__'. The other qualifiers do not accept types that have already
  6734. been modified with a type qualifier.
  6735.  
  6736.    The syntax to use the qualifiers:
  6737.  
  6738.      type-denoter > TYPE-QUALIFIER type-name
  6739.  
  6740.    (The metasymbol `>' means type-denoter has also other meanings)
  6741.  
  6742.    Most of these should be done with subranges anyway.  However,
  6743. '`__short__ real'' can not be done like that, neither can
  6744. '`__unsigned__ integer'' or '`__longlong__ integer''.
  6745.  
  6746.      program zap(output);
  6747.      
  6748.      type
  6749.         byte     = __byte__     integer;
  6750.         longint  = __long__     integer;
  6751.         float    = __short__    real;
  6752.         u_long   = __unsigned__ longint;
  6753.         verylong = __longlong__ integer;
  6754.      
  6755.      var
  6756.        i8  : byte;
  6757.        i16 : __short__ integer;
  6758.        foo : u_long;
  6759.        pi  : float;
  6760.        big : verylong;
  6761.      
  6762.      begin
  6763.        pi  := 3.141592654;
  6764.        i16 := 1000;
  6765.        big := MaxInt * i16;
  6766.        i8  := 127;
  6767.      
  6768.        (*
  6769.         * Hmm, does not work because constant is treated as an integer,
  6770.         * and this is too large. Need a method to specify long constants.
  6771.         *
  6772.         * What is the syntax in other Pascal compilers? Suggestions, please!
  6773.         *
  6774.      
  6775.        foo := 16#deadbeef;
  6776.      
  6777.         *)
  6778.      end.
  6779.  
  6780. Accessing command line arguments:
  6781. ---------------------------------
  6782.  
  6783.    The following module accesses the command line with `ParamStr' and
  6784. `ParamCount' functions.
  6785.  
  6786.    These follow the Un*x semantics, so that
  6787.    * `arg[0]' == program name,
  6788.  
  6789.    * `arg[1] .. arg[ParamCount-1]' are the arguments.
  6790.  
  6791.      MODULE command_line interface;
  6792.      
  6793.      EXPORT cmdline = (Max_length, Arg_type, ParamStr, ParamCount);
  6794.      
  6795.      CONST
  6796.         Max_length = 255;     { Max length of each argument.
  6797.                                 If some arg is longer, the run time system
  6798.                                 traps it. }
  6799.      
  6800.      TYPE
  6801.        Arg_type = String(Max_length);
  6802.      
  6803.        FUNCTION ParamCount: Integer;
  6804.      
  6805.        FUNCTION ParamStr (arg_num: integer): Arg_type;
  6806.      END. { command_line interface }
  6807.      
  6808.      MODULE command_line implementation;
  6809.      
  6810.        { These are in the GPC runtime library }
  6811.        FUNCTION _p_paramcount : Integer; C;
  6812.        FUNCTION _p_paramstr (num: Integer; VAR str: String): Boolean; C;
  6813.      
  6814.        FUNCTION ParamCount;
  6815.        BEGIN
  6816.           ParamCount := _p_paramcount;
  6817.        END; { ParamCount }
  6818.      
  6819.        FUNCTION ParamStr;
  6820.      
  6821.        VAR
  6822.         Str       : Arg_type;
  6823.         Success     : Boolean;
  6824.      
  6825.        BEGIN
  6826.           Success := _p_paramstr (arg_num, Str);
  6827.      
  6828.           (* Should perhaps do something else on failure.
  6829.            *
  6830.            * Now it returns the empty string, which is also a valid
  6831.            * parameter.
  6832.            *)
  6833.           IF Success THEN
  6834.              ParamStr := Str
  6835.           else
  6836.              ParamStr := '';
  6837.        END; { ParamStr }
  6838.      END. { command_line implementation }
  6839.      
  6840.      
  6841.      { The program below, when compiled with the interface module and
  6842.        linked with the implementation module, accesses the command
  6843.        line arguments. }
  6844.      
  6845.      program zap (output);
  6846.      
  6847.      import cmdline;
  6848.      
  6849.      var
  6850.         counter : integer;
  6851.      
  6852.      begin
  6853.         writeln ('Program fetches command line arguments and outputs one per line');
  6854.         writeln ('Max length of each argument is ',Max_Length:1,' characters');
  6855.      
  6856.         for counter := 0 to ParamCount-1 do
  6857.            writeln ('Command line arg ',counter:1,' is "',paramstr(counter),'"');
  6858.      end.
  6859.  
  6860. Borland Extensions in GNU Pascal
  6861. ================================
  6862.  
  6863.    GNU Pascal implements these Borland extensions to the ISO Pascal
  6864. language:
  6865.  
  6866.    * Program headline:  The `Program' headline may be omitted in TP/BP.
  6867.      If the headline is given, the parameters `Input' and `Output' are
  6868.      optional.  I modified GPC such that it warns about a missing
  6869.      program header, but warns about missing `Input' and `Output'
  6870.      parameters only if `pedantic'.
  6871.  
  6872.    * Units:  Extended Pascal "Modules" are not too different from TP/BP
  6873.      "Units".  The main difference is that modules do not automatically
  6874.      export everything mentioned in the interface part, but they need
  6875.      additional export clauses.  (Why?  For what does the interface part
  6876.      serve if not just to document what should be exported?)  So I im-
  6877.      plemented TP/BP "Units".  A Unit exports everything declared in the
  6878.      interface section.  The exported interface has the name of the Unit
  6879.      and is compatible with Extended Pascal Module interfaces since I
  6880.      just used the same routines.
  6881.  
  6882.      I got in trouble with "Interface" and "Implementation" which must
  6883.      be reserved words in order to compile a Unit.  On the other hand
  6884.      side they must remain redefinable to stay compatible to ISO 7185.
  6885.      I solved the problem by implementing a mechanism to "enable" and
  6886.      "disable" keywords.  When the identifier "Unit" or "Module" is
  6887.      read, "Interface" and "Implementation" are enabled as keywords.
  6888.      When compiling a valid ISO 7185 program, "Program" must be the
  6889.      first identifier, and "Interface" and "Implementation" are disabled
  6890.      and have no special meaning.  At the "end." of each compilation,
  6891.      everything is set back, so one project can mix ISO 7185 and 10206
  6892.      plus Borland standard.
  6893.  
  6894.      (By the way:  The "GNU specific" module definition is almost
  6895.      identical to the PXSC standard (see below: Operators).  With an
  6896.      additional keyword `global' which puts a declaration into an
  6897.      export interface with the name of the module, it will be the same.
  6898.      I am planning to implement this too.)
  6899.  
  6900.    * Protected formal parameters:  Using the same mechanism as above
  6901.      (and an additional hack in gpc-lex.c), I solved the "protected"
  6902.      problem.  All the following works now:
  6903.  
  6904.           Procedure Foo ( protected a, b, c: Integer );      (* 3 args *)
  6905.           Procedure Foo ( a, b, c, protected: Integer );     (* 4 args *)
  6906.           Procedure Foo ( a, b, protected, c: Integer );     (* 4 args *)
  6907.           Procedure Foo ( protected: Integer );              (* 1 arg  *)
  6908.           Procedure Foo ( Var protected: Integer );          (* 1 arg  *)
  6909.           Procedure Foo ( protected protected: Integer );    (* 1 arg  *)
  6910.  
  6911.      Furthermore, I implemented "Const" as an alternative to "protected"
  6912.      (according to Borland Pascal)
  6913.  
  6914.    * Compiler directives vs. preprocessor:  UCSD and Borland treat
  6915.      comments beginning with a '$' immediately following the opening
  6916.      `{' or `(*' as a compiler (or preprocessor) directive.  When a
  6917.      single character plus a `+' or `-' follows, this is also called a
  6918.      compiler switch, often associated with a command-line option.  All
  6919.      these directives are case-insensitive.
  6920.  
  6921.      For this extension, only the principle idea, not the implementation
  6922.      is related to Borland and UCSD.  It is okay (at least between
  6923.      Borland and UCSD) to have compiler-dependent compiler-switches.
  6924.      Only the include directive (*$I FileName *) is "standard" in both
  6925.      (now in three) Pascal dialects.
  6926.  
  6927.      Some Borland extensions are - of course not by chance - just an
  6928.      alternative notation for C preprocessor directives.  But there are
  6929.      differences:  Borland Pascal "preprocessor" definitions go into
  6930.      another name space than the program's definitions.  Therefore you
  6931.      can (*$D define *) so-called "conditionals" and check them via
  6932.      (*$ifdef *), but the program will not see these defines, so macros
  6933.      do not exist.  Since it was easier, makes no difference in most
  6934.      cases, and is in fact an extension, I left (*$define s*) visible to
  6935.      the program.  And I did not forbid to use the other C preprocessor
  6936.      directives in the Pascal style.  (Like this, there may be more than
  6937.      one in the same line ... )
  6938.  
  6939.      I implemented the following directives  (The examples simultane-
  6940.      ously illustrate different possible notations):
  6941.  
  6942.           (*$B+*)  or  {$B+}            Boolean complete evaluation
  6943.           (*$B-*)  or  {$B-}            --short-circuit
  6944.           
  6945.           (*$c+*)  or  {$c+}            --c-numbers
  6946.           
  6947.           (*$E+,L+,N+*)                 --char-escapes, --lazy-io,
  6948.                                         --nested-comments
  6949.           
  6950.           (* These switches are local and can change during one compile *)
  6951.           
  6952.           {$p+}                         --pedantic
  6953.           {$P-}                         end of --pedantic
  6954.           
  6955.           (*$I FileName *)              #include "filename.pas"
  6956.           
  6957.           {$m Hello! }                  write message "Hello!" to stderr
  6958.           
  6959.           (*$D FOO bar *)               #define FOO bar
  6960.           {$define CMULB}               #define CMULB
  6961.           
  6962.           (*$include <hello.ph> *)      #include <hello.ph>
  6963.           
  6964.                                         #ifdef FOO
  6965.           (*$ifdef FOO*) ... (*$endif*)   ...
  6966.                                         #endif
  6967.           
  6968.           (* ... and all the other C preprocessor directives ... *)
  6969.  
  6970.      By the way:  I implemented an option -borland-pascal symmetrically
  6971.      to -extended-pascal and -object-pascal.  But I couldn't figure out
  6972.      what they serve for since I didn't notice any difference in the
  6973.      compiler's behaviour with and without these options.  Nevertheless,
  6974.      I made -borland-pascal to switch on -nested-comments, so it has at
  6975.      least one effect :-).
  6976.  
  6977.    * Bit manipulations:  The TP/BP bit shift operators "shl" and "shr"
  6978.      do now exist in GPC; bitwise "and", "or", "xor", and "not" for
  6979.      integer values are allowed.  Warning is given, if "pedantic" -
  6980.      like for all non-ISO extensions.
  6981.  
  6982.           2#100101 and ( 1 shl 5 ) = 2#100000
  6983.  
  6984.      I could not restrain, but also implemented "and", "or", "xor" and
  6985.      "not" as "procedures":
  6986.  
  6987.           x:= 7;
  6988.           and ( x, 14 );          (* yields 6 *)
  6989.           xor ( x, 3 );           (* yields 5 *)
  6990.  
  6991.      (This is a feature I often missed with Borland Pascal.)
  6992.  
  6993.    * Increment, decrement:  The TP/BP built-in Procedures "inc" and
  6994.      "dec" do now exist in GPC.
  6995.  
  6996.           Var
  6997.             x: Integer;
  6998.             c: Char;
  6999.           
  7000.           inc ( i );      (* i:= i + 1; *)
  7001.           dec ( i, 7 );   (* i:= i - 7; *)
  7002.           inc ( c, 3 );   (* c:= chr ( ord ( c ) + 3 ); *)
  7003.  
  7004.    * Min, max:  These are a GNU extension and work for reals as well as
  7005.      for ordinal types.  Mixing of reals and integers is okay (result
  7006.      is real).
  7007.  
  7008.    * Memory management:  TP/BP allows dynamic memory management with
  7009.      `GetMem' and `FreeMem':
  7010.  
  7011.           GetMem ( MyPtr, 1024 );       FreeMem ( MyPtr, 1024 );
  7012.  
  7013.      GPC now supports this and also a "function-style" call to `GetMem':
  7014.  
  7015.           MyPtr:= GetMem ( 1024 );
  7016.  
  7017.      (see also: New in context of Object Orientated Programming)
  7018.  
  7019.      One somehow strange feature of Borland is *not* supported:  You can
  7020.      free parts of a variable with FreeMem, while the rest is still used
  7021.      and can be FreeMem'ed later by another pointer:
  7022.  
  7023.           Type
  7024.             Vector = array [ 0..65535 ] of Integer;
  7025.             VecPtr = ^Vector;
  7026.           
  7027.           Var
  7028.             p, q: VecPtr;
  7029.           
  7030.             ...
  7031.           
  7032.             GetMem ( p, 1024 * SizeOf ( Integer ) );
  7033.             q:= &p^ [ 512 ];
  7034.             ...
  7035.             FreeMem ( p, 512 * SizeOf ( Integer ) );
  7036.             ...
  7037.             FreeMem ( q, 512 * SizeOf ( Integer ) );
  7038.  
  7039.    * Hex numbers:  TP/BP hex numbers with a leading `$' are now
  7040.      supported by GPC parallel to base#number.
  7041.  
  7042.           $cafe = 2#1100101011111110
  7043.  
  7044.    * Typed constants vs. initialized variables:  TP/BP "typed constants"
  7045.      can now be used in GPC too.  Currently, they are just initialized
  7046.      variables (as in TP/BP), but they will be changed at least to read-
  7047.      only variables.  (Or at least a warning will be given when trying
  7048.      to change their values.)  I recommand to use typed constants only
  7049.      for effective constants and use Extended Pascal initialized
  7050.      variables as initialized variables.
  7051.  
  7052.           Const
  7053.             A: Integer = 7;
  7054.             B: array [ 1..3 ] of Char = ( 'B', 'a', 'r' );
  7055.                (* TP/BP also would also understand " = 'Bar'; ". *)
  7056.             Foo: record
  7057.               x, y: Integer;
  7058.             end (* Foo *)
  7059.               = ( x: 3; y: 4 );
  7060.  
  7061.      Borland and ISO style for the right-hand side are both supported.
  7062.  
  7063.      Once working on this, I also implemented VAX Pascal variable ini-
  7064.      tializing with `:=' (as an alternative to `value') and also with
  7065.      `=' (like in Borland "initialized variables").
  7066.  
  7067.      Warning: This was one of my last changes and is not yet stable.  I
  7068.      could not, for example, recover from 3 shift/reduce conflicts and 1
  7069.      reduce/reduce conflict.  This causes trouble when the type (for
  7070.      example a subrange) ends up with an expression such that the parser
  7071.      takes the `=' as a relational operator.
  7072.  
  7073.    * Absolute variables:  The "absolute" clause does now exist in GPC,
  7074.      but only for superposition of variables, not for giving an abso-
  7075.      lute address for variables.  (The latter application is useful only
  7076.      in the DOS platform anyway.)
  7077.  
  7078.           Procedure ReadVar ( Var x: Void; TypeChoice: Char );
  7079.           
  7080.           Var
  7081.             xInt: Integer absolute x;
  7082.             xChar: Char absolute x;
  7083.             xStr: String ( 80 ) absolute x;
  7084.           
  7085.           begin (* ReadVar *)
  7086.             ...
  7087.           end (* ReadVar *);
  7088.  
  7089.    * AsmName directive:  As a GNU extension, I implemented a new direc-
  7090.      tive `AsmName'.  While the `extern' directive capitalizes the first
  7091.      character of the declared name and the `C' directive makes every-
  7092.      thing lowercase, this directive allows the user to specify the
  7093.      assembler name as a string constant:
  7094.  
  7095.           Function MyFunc: Integer; AsmName 'MyPrettyFunc_';
  7096.  
  7097.      With this extension it is possible to access all external
  7098.      functions, for example the XT interface functions, and not only
  7099.      those written in lowercase.
  7100.  
  7101.      My first idea to use `external' for this purpose (to avoid name
  7102.      space pollution) conflicts with another Borland extension not yet
  7103.      implemen- ted:  In Borland Pascal, the declaration
  7104.  
  7105.           Procedure Foo; external 'MyLib';
  7106.  
  7107.      means that the procedure Foo should be imported by name ("Foo")
  7108.      from a dynamic link library "mylib.dll".
  7109.  
  7110.    * Open arrays:  Borland Pascal "open array" formal parameters are now
  7111.      implemented into GPC.  Within the function body, they have integer
  7112.      type index with lower bound 0.  Currently, a warning about invalid
  7113.      pointer conversion is given; code works.  (Conformant arrays are
  7114.      probably better but are incompatible to other languages.)
  7115.  
  7116.    * Address operator:  The address operator is "`@'" in TP/BP.
  7117.      Implemented into GPC as an alternative to "`&'".
  7118.  
  7119.    * Variant records:  Variant records may now be constructed with a
  7120.      subrange type, too.  E.g. "`case 1..3 of ...'" is allowed now.
  7121.  
  7122.    * Objects (classes):  The Borland Pascal Object Extensions are almost
  7123.      fully implemented into GPC.  This includes inheritance, virtual and
  7124.      non-virtual methods, constructors, destructors, pointer compati-
  7125.      bility, extended `New' syntax (with constructor call and/or as a
  7126.      "function"), extended `Dispose' syntax (with destructor call).
  7127.  
  7128.      The Borland "standard" is different from the ISO draft (which I
  7129.      have never seen), but it should not be too difficult now to im-
  7130.      plement that too (plus the Borland Delphi Object Extensions which
  7131.      *might* be identical to the ISO draft).
  7132.  
  7133.           Type
  7134.             MyParentPtr = ^MyParentObj;
  7135.             MyPtr = ^MyObj;
  7136.           
  7137.           MyParentObj = object
  7138.             ...
  7139.           end (* MyParentObj *);
  7140.           
  7141.           MyObj = object ( MyParentObj )
  7142.             a, b, c: Integer;
  7143.             Constructor Init;
  7144.             d, e: Char;    (* GNU extension: Data fields *)
  7145.             Destructor Fini; virtual;(* and methods may be mixed   *)
  7146.             Procedure Foo ( x: Integer );
  7147.             Function Bar: Char; virtual;
  7148.             (* "private" is not (yet) implemented *)
  7149.           end (* MyObj *);
  7150.           
  7151.           Var
  7152.             My: MyParentPtr;
  7153.           
  7154.           ...
  7155.           
  7156.           Constructor MyObj.Init;
  7157.           
  7158.           begin (* MyObj.Init *)
  7159.             inherited Init;
  7160.             a:= 0;
  7161.             MyParentObj.Bar;
  7162.           end (* MyObj.Init *);
  7163.           
  7164.           ...
  7165.           
  7166.           My:= New ( MyPtr, Init );
  7167.           My^.Foo ( 3 );
  7168.           Dispose ( My, Fini );
  7169.           New ( My, Init );
  7170.           with My^ do
  7171.             writeln ( Bar );
  7172.  
  7173.      I first tried to recycle parts of the C++ and/or ObjC frontend, but
  7174.      I gave up after a few hours.  Since I was not able to understand
  7175.      how they work, I re-invented and implemented my own Object frontend
  7176.      - the third one I noticed in the GNU compiler family.  Sorry.
  7177.  
  7178.    * Operators:  This extension is not from Borland but from the PXSC
  7179.      (Pascal eXtensions for Scientific Calculations) standard and allows
  7180.      redefinition of operators.  It must explicitly be enabled either by
  7181.      the compiler directive $X+ ("extended syntax") or by a command line
  7182.      option "-pascal-sc" or "-extended-syntax".
  7183.  
  7184.           (*$X+*)
  7185.           
  7186.           Type
  7187.             Vec3 = record
  7188.               x, y, z: Real;
  7189.             end (* Vec3 *);
  7190.           
  7191.           Var
  7192.             a, b, c: Vec3;
  7193.           
  7194.           Operator + ( u, v: Vec3 ) w: Vec3;
  7195.           
  7196.           begin (* Vec3 + Vec3 *)
  7197.             w.x:= u.x + v.x;
  7198.             w.y:= u.y + v.y;
  7199.             w.z:= u.z + v.z;
  7200.           end (* Vec3 + Vec3 *);
  7201.           
  7202.           ...
  7203.           
  7204.           c:= a + b;
  7205.  
  7206.      Extended Pascal would require an equal sign before the return value
  7207.      variable specification (`w' in the above example) while PXSC for-
  7208.      bids it.  Therefore I allow the equal sign to be present or not,
  7209.      both in a function declaration as well as in an operator
  7210.      declaration.
  7211.  
  7212. 
  7213. File: ^.!gcc.docs.pascal.gpc,  Node: Extended Pascal,  Next: Borland Pascal,  Prev: Extensions,  Up: Top
  7214.  
  7215. About Pascal and Extended Pascal languages
  7216. ******************************************
  7217.  
  7218.    Pascal is a well-known programming language and hardly needs to be
  7219. described here.  Notice, however, that some people's idea of Pascal is
  7220. affected by acquaintance with such products as Turbo Pascal which
  7221. differ from the Pascal standard and provide a lot of nonstandard
  7222. extensions (some of which are compatible with the Extended Pascal
  7223. standard).  Moreover, it is worth mentioning that the ISO Pascal
  7224. standard defines two levels of the language, level 0 and level 1; the
  7225. only difference between the levels is that level 1 supports the
  7226. so-called conformant array schemas in parameter declarations.
  7227.  
  7228.    Extended Pascal is a standardized language which contains so
  7229. significant extensions to Pascal that it is best regarded as a new
  7230. language.  It is currently not very well known, and computer vendors do
  7231. not seem to be eager to provide compilers for it.  Thus, there is
  7232. social need for GNU Pascal supporting Extended Pascal.
  7233.  
  7234. A comparison of Borland Turbo Pascal with Extended Pascal
  7235. =========================================================
  7236.  
  7237.    As mentioned earlier, Turbo Pascal does not conform to any of the
  7238. Pascal standards.  If you carefully chose a subset of unextended
  7239. Pascal, you may be able to port code if you're lucky/careful.
  7240.  
  7241.    To be fair, Turbo Pascal has some wonderful features that make it
  7242. very powerful in the environments in which it runs.  However, some of
  7243. those features are of little use on non Windows/DOS platforms and
  7244. probably are not good candidates for standardization.
  7245.  
  7246.    There are several Turbo Pascal features which are semantically
  7247. similar to features in unextended Pascal or Extended Pascal.  Here is a
  7248. list of mappings between Turbo Pascal features and Extended Pascal
  7249. features:
  7250.  
  7251.    * Case constructs
  7252.  
  7253.        a. Extended Pascal uses `otherwise' instead of `else'.
  7254.  
  7255.           *Borland Pascal*
  7256.                case c of
  7257.                  'A' : ;
  7258.                  'B' : ;
  7259.                  else ...;
  7260.                end;
  7261.  
  7262.           *Extended Pascal*
  7263.                case c of
  7264.                  'A' : ;
  7265.                  'B' : ;
  7266.                  otherwise ...;
  7267.                end;
  7268.  
  7269.        b. Missing cases cause Extended Pascal compilers to halt. In the
  7270.           case statement above if you had no `otherwise' clause and
  7271.           char c had the value 'C', you got an error (note, this would
  7272.           be unnoticed in Borland Pascal).
  7273.  
  7274.  
  7275.    * Procedure and function types and variables
  7276.  
  7277.      Here is an area of subtle differences.  Turbo Pascal has true
  7278.      procedure/function types but doesn't have standard Pascal's
  7279.      procedural/functional parameters.
  7280.  
  7281.      *Borland Pascal*
  7282.           type
  7283.             CompareFunction = function(Key1, Key2 : string) : integer;
  7284.           
  7285.           function Sort(Compare : CompareFunction);
  7286.           begin
  7287.             ...
  7288.           end;
  7289.  
  7290.      *Extended Pascal*
  7291.           function Sort(Compare : function(Key1, Key2 : string) : integer);
  7292.           begin
  7293.             ...
  7294.           end;
  7295.  
  7296.      Moving from Turbo Pascal to Extended Pascal might be difficult if
  7297.      the Turbo Pascal program saves, compares, trades, etc. procedure
  7298.      values.  For example, an array of procedure values isn't possible
  7299.      in Extended Pascal.  Moving the other way is a little easier as
  7300.      show by the above examples.
  7301.  
  7302.    * Strings
  7303.  
  7304.        a. Borland Pascal's string type has a special case, namely
  7305.           `string' without a length meaning the same as `string[255]'.
  7306.           There is no default in Extended Pascal so you have to change
  7307.           all string types to `string(255)'. Example:
  7308.  
  7309.                var
  7310.                  s : string;
  7311.  
  7312.           becomes:
  7313.                var
  7314.                  s : string(255);
  7315.  
  7316.           Note also that you have to use parentheses instead of
  7317.           brackets.
  7318.  
  7319.        b. A nice pitfall is the pointer to string as in:
  7320.  
  7321.                type
  7322.                  PString = ^String;
  7323.  
  7324.           In Extended Pascal this is a pointer to a schema type! Don't
  7325.           forget to translate this to:
  7326.  
  7327.                type
  7328.                  string255 = string(255);
  7329.                  PString = ^string255;
  7330.  
  7331.           If you indeed want to use String as a schema pointer you can
  7332.           define things like:
  7333.  
  7334.                type
  7335.                  MyStr : ^String;
  7336.                begin
  7337.                  New(MyStr, 1024);
  7338.                end;
  7339.  
  7340.           to allocate 1024 bytes of string space.
  7341.  
  7342.        c. As you could see above, Extended Pascal has no 255 byte limit
  7343.           for strings. It is however save to assume a limit of about
  7344.           32000 bytes. At least Prospero's Extended Pascal limits
  7345.           strings to 32760 bytes. GNU Pascal seems to allow larger
  7346.           strings.  DEC Pascal limits strings to 65535 bytes.
  7347.  
  7348.  
  7349.    * Constant variables
  7350.  
  7351.        a. Extended Pascal translates Borland's gruesome:
  7352.  
  7353.                const
  7354.                  i:integer = 0;
  7355.  
  7356.           to:
  7357.  
  7358.                var
  7359.                  i : integer value 0;
  7360.  
  7361.        b. You can also assign initialization values to types. Like:
  7362.  
  7363.                type
  7364.                  MyInteger = integer value 0;
  7365.                
  7366.                var
  7367.                  i : MyInteger;
  7368.  
  7369.           All variables of type MyInteger are automatically initialized
  7370.           to 0 when created.
  7371.  
  7372.        c. Constant arrays of type string are translated from:
  7373.  
  7374.                const
  7375.                  MyStringsCount = 5;
  7376.                type
  7377.                  Ident = string[20];
  7378.                const
  7379.                  MyStrings : array [1..MyStringsCount] of Ident = (
  7380.                                'EXPORT', 'IMPLEMENTATION', 'IMPORT', 'INTERFACE',
  7381.                                'MODULE');
  7382.  
  7383.           to:
  7384.  
  7385.                const
  7386.                  MyStringsCount = 5;
  7387.                type
  7388.                  Ident = string(20);
  7389.                var
  7390.                  MyStrings : array [1..MyStringsCount] of Ident value [
  7391.                    1:'EXPORT'; 2:'IMPLEMENTATION'; 3:'IMPORT';
  7392.                    4:'INTERFACE'; 5:'MODULE'];
  7393.  
  7394.           There seem to be pros and cons to each style.
  7395.  
  7396.           Some folks don't like having to specify an index since it
  7397.           requires renumbering if you want to add a new item to the
  7398.           middle.  However, if you index by an enumerated type, you
  7399.           might be able to avoid major renumbering by hand.
  7400.  
  7401.  
  7402.    * Variant records
  7403.  
  7404.      The following construction is not allowed in Extended Pascal:
  7405.           type
  7406.             PersonRec = record
  7407.               Age : integer;
  7408.               case EyeColor : (Red, Green, Blue, Brown) of
  7409.                 Red, Green : (Wears_Glasses : Boolean);
  7410.                 Blue, Brown : (Length_of_lashes : integer);
  7411.               end;
  7412.             end;
  7413.  
  7414.      The variant field needs an explicit type. Code this as:
  7415.  
  7416.           type
  7417.             EyeColorType = (Red, Green, Blue, Brown);
  7418.             PersonRec = record
  7419.               Age : integer;
  7420.               case EyeColor : EyeColorType of
  7421.                 Red, Green : (Wears_Glasses : Boolean);
  7422.                 Blue, Brown : (Length_of_lashes : integer);
  7423.               end;
  7424.             end;
  7425.  
  7426.    * Units
  7427.  
  7428.        a. You can translate units almost automatically to Extended
  7429.           Pascal Modules, taking into account some differences of
  7430.           course.
  7431.  
  7432.           Extended Pascal does not automatically export everything named
  7433.           in a module, but you have to create seperate export clauses.
  7434.  
  7435.           For example translate the following unit:
  7436.  
  7437.                unit A;
  7438.                
  7439.                interface
  7440.                
  7441.                uses
  7442.                  B, C;
  7443.                
  7444.                procedure D;
  7445.                
  7446.                implementation
  7447.                
  7448.                procedure D;
  7449.                begin
  7450.                end;
  7451.                
  7452.                end.
  7453.  
  7454.           to this module:
  7455.  
  7456.                module A interface;
  7457.                
  7458.                export
  7459.                  A = (D);
  7460.                
  7461.                import
  7462.                  B;
  7463.                  C;
  7464.                
  7465.                procedure D;
  7466.                
  7467.                end.
  7468.                
  7469.                module A implementation;
  7470.                
  7471.                procedure D;
  7472.                begin
  7473.                end;
  7474.                
  7475.                end.
  7476.  
  7477.           You can have one or more export clauses and the name of an
  7478.           export clause doesn't have to be equal to the name of the
  7479.           module.
  7480.  
  7481.           You also see in this example how to translate the Borland
  7482.           Pascal "uses" clause to the Extended Pascal "import" clause.
  7483.  
  7484.        b. Borland Pascal allows you to have code in a unit that is
  7485.           executed once, at startup, to initialize things. You can
  7486.           translate this to Extended Pascal's "to begin do ..end"
  7487.           structure.
  7488.  
  7489.           *Borland Pascal*
  7490.                unit A;
  7491.                
  7492.                interface
  7493.                
  7494.                implementation
  7495.                
  7496.                begin
  7497.                  { do something }
  7498.                end.
  7499.  
  7500.           *Extended Pascal*
  7501.  
  7502.                module A interface;
  7503.                end.
  7504.                
  7505.                module A implementation;
  7506.                
  7507.                to begin do begin
  7508.                  { do something }
  7509.                end;
  7510.                
  7511.                end.
  7512.  
  7513.           Extended Pascal also has a `"to end do .... end"' so you can
  7514.           translate `Exit' handlers also.
  7515.  
  7516.  
  7517.    * Files
  7518.  
  7519.      Extended Pascal treats files quite differently as Borland Pascal.
  7520.      I'm not going to treat file pointers, Get and Put here, but
  7521.      instead I focus on special Extended Pascal features.
  7522.  
  7523.      In Borland Pascal you can read any text file as follows:
  7524.  
  7525.           var
  7526.             t : text;
  7527.             Line : string;
  7528.           begin
  7529.             Assign(t, 'MYTEXT.TXT');
  7530.             Reset(t);
  7531.             while not eof(t) do  begin
  7532.               readln(t, Line);
  7533.               writeln(Line);
  7534.             end;
  7535.           end;
  7536.  
  7537.      The `Assign' function associated the textfile `T' with the file
  7538.      `MYTEXT.TXT'.
  7539.  
  7540.      In Extended Pascal, files are considered entities external to your
  7541.      program. External entities, which don't need to be files, need to
  7542.      be bound to a variable your program. Any variable to which
  7543.      external entities can be bound needs to be declared bindable. So
  7544.      the variable declaration of t becomes:
  7545.  
  7546.           var
  7547.             t : bindable text;
  7548.  
  7549.      Extended Pascal has the bind function that binds a variable with
  7550.      an external entity.  Here is an Extended Pascal procedure that
  7551.      emulates the Assign procedure in Turbo Pascal.
  7552.  
  7553.           procedure Assign(var t : text; protected Name : string);
  7554.           var
  7555.             b : BindingType;
  7556.           begin
  7557.             unbind (t);
  7558.             b := binding (t);
  7559.             b.Name := Name;
  7560.             bind (t, b);
  7561.             b := binding (t);
  7562.           end;
  7563.  
  7564.      Comments: the unbind procedure unbinds a bindable variable from
  7565.      its external entity. If it is not bound, nothing happens. The
  7566.      binding function initializes b. We call binding to set some fields
  7567.      of the BindingType record. Next we set the name field to the name
  7568.      of the file. Calling bind will bind t to the external entity. If
  7569.      we now call binding again, we get the current state of t's binding
  7570.      type. We can now check for example if the bind has succeeded by:
  7571.  
  7572.           if not b.bound then
  7573.             { do error processing }
  7574.  
  7575.      Note that Prospero's Pascal defaults to creating the file if it
  7576.      does not exists! You need to use Prospero's local addition of
  7577.      setting `b.existing' to `true' to work-around this.
  7578.  
  7579.      I've not worked with binary files enough, so no advice yet on how
  7580.      to access them, but you access them much the same.
  7581.  
  7582.      As last an example of getting the size of a file.
  7583.  
  7584.           function FileSize(filename : String) : LongInt;
  7585.           var
  7586.             f : bindable file [0..MaxInt] of char;
  7587.             b : BindingType;
  7588.           begin
  7589.             unbind(f);
  7590.             b := binding (f);
  7591.             b.Name := filename;
  7592.             bind(f, b);
  7593.             b := binding(f);
  7594.             SeekRead(f, 0);
  7595.             if empty(f)
  7596.               then  file_size := 0
  7597.               else  file_size := LastPosition(f) + 1;
  7598.             unbind(f);
  7599.           end(*file_size*);
  7600.  
  7601.      Prospero's Extended Pascal has a bug in this case. Replace the
  7602.      MaxInt in the type definition of f by a sufficiently large
  7603.      integer. GNU Pascal works correct in this case.
  7604.  
  7605. 
  7606. File: ^.!gcc.docs.pascal.gpc,  Node: Borland Pascal,  Next: FPK Pascal,  Prev: Extended Pascal,  Up: Top
  7607.  
  7608. From Borland Pascal to GNU Pascal
  7609. *********************************
  7610.  
  7611.    This chapter is intended to be a QuickStart guide for programmers
  7612. who are familiar with Borland Pascal, version 7 for DOS protected mode.
  7613. Other versions don't differ too much but this one is the very last DOS
  7614. version Borland has published.
  7615.  
  7616. * Menu:
  7617.  
  7618. * Borland compatibility::
  7619. * There is no IDE!::
  7620. * Comments and compiler directives::
  7621. * Units; GPI files and AutoMake::
  7622. * Optimization::
  7623. * Debugging::
  7624. * GPC inline assembler::
  7625. * Objects::
  7626. * Strings::
  7627. * Typed constants::
  7628. * Bit; byte and memory manipulation::
  7629. * User-defined operators::
  7630. * Data types::
  7631. * Files::
  7632. * Built-in constants::
  7633. * Built-in operators::
  7634. * Built-in Procedures and Functions::
  7635. * Parameters::
  7636. * Miscellaneous::
  7637.  
  7638. 
  7639. File: ^.!gcc.docs.pascal.gpc,  Node: Borland compatibility,  Next: There is no IDE!,  Up: Borland Pascal
  7640.  
  7641. Borland compatibility
  7642. =====================
  7643.  
  7644.    Unlike other FreeWare compilers, GNU Pascal is *not* intended to be
  7645. 100% Borland compatible.  GNU Pascal is part of the GNU project, so
  7646. portability is one of its primary goals.  For this reason, non-portable
  7647. features of Borland Pascal will probably not be included into GNU
  7648. Pascal.  Some other differences are so minimal that we have more
  7649. important things to do than to implement them.
  7650.  
  7651.    However if you want to contribute to GNU Pascal by eliminating holes
  7652. in GPC's Borland compatibility, be welcome in the GNU Pascal
  7653. development team!  See *Note How to Contribute:: for details.
  7654.  
  7655. 
  7656. File: ^.!gcc.docs.pascal.gpc,  Node: There is no IDE!,  Next: Comments and compiler directives,  Prev: Borland compatibility,  Up: Borland Pascal
  7657.  
  7658. There is no IDE!
  7659. ================
  7660.  
  7661.    It is one of the most annoying points about GPC that there is no
  7662. Integrated Development Environment like BP.EXE at the moment.  We are
  7663. working on it, but this will take some time, especially because GNU
  7664. Pascal is a *portable* compiler intended to run under a large variety
  7665. of operating systems in the same manner.  Please be patient--or offer
  7666. your help!  (For the moment, you can try to use Borland's IDE for GNU
  7667. Pascal--see below.)
  7668.  
  7669.    The GNU Pascal Compiler, GPC, is called about like the command-line
  7670. version of the Borland Pascal Compiler, BPC.  Edit your source file(s)
  7671. with your favorite ASCII editor (e.g. the Borland IDE), then call GNU
  7672. Pascal with a command line like
  7673.  
  7674.        C:\GNU-PAS> gpc hello.pas
  7675.  
  7676. on your DOS or OS/2 box or
  7677.  
  7678.        myhost/home/joe/gnu-pascal> gpc hello.pas -o hello
  7679.  
  7680. on your UNIX (e.g. Linux or FreeBSD) box.  Don't omit the suffix
  7681. `.pas':  GPC is a common interface for a Pascal compiler, a C, ObjC and
  7682. C++ compiler, an assembler, a linker, and perhaps a Modula and FORTRAN
  7683. compiler.  From the extension of your source file GPC figures out which
  7684. processor to run.
  7685.  
  7686.    The `-o' is a command line option which tells GPC how the executable
  7687. has to be named.  This is not necessary for DOS and OS/2, so we omit it
  7688. in this file from now on.
  7689.  
  7690.    Note that GPC is case-sensitive concerning file names, so it will
  7691. *not* work if you type
  7692.  
  7693.        C:\GNU-PAS> GPC HELLO.PAS
  7694.  
  7695.    GPC is a very quiet compiler and doesn't print anything on the
  7696. screen unless you request it or there is an error.  If you want to see
  7697. what is going on, invoke GPC with additional options:
  7698.  
  7699.        -Q            "don't be quiet"  (or: Quassel-Modus in German)
  7700.  
  7701. means that GPC prints out the names of procedures and functions it
  7702. processes, and
  7703.  
  7704.        --verbose
  7705.  
  7706. means that GPC informs you about the stages of compilation, i.e.
  7707. preprocessing, compiling, assembling, and linking.
  7708.  
  7709.    One example (this time for OS/2):
  7710.  
  7711.        [C:\GNU-Pascal] gpc --verbose -Q hello.pas
  7712.  
  7713.    Throughout this chapter, we will tell you about a lot of
  7714. command-line switches.  They are all invoked this way.
  7715.  
  7716.    After compilation, there will be an executable `hello' file in the
  7717. current directory.  (`hello.exe' with DOS and OS/2.)  Just run it and
  7718. enjoy.  If there are errors, GNU Pascal will not stop compilation after
  7719. the first one--as Borland Pascal does--but try to catch them all in one
  7720. compilation.  If you get more error messages than your screen can hold,
  7721. you can catch them in a file (e.g. `gpc.out') in the following way:
  7722.  
  7723.        gpc hello.pas 2>gpc.out
  7724.  
  7725.    This works with DOS, OS/2 and any bash-like shell under UNIX.
  7726.  
  7727.    However, you can use Borland's IDE for GNU Pascal on the DOS
  7728. platform:  Install the GNU Pascal Compiler in the Tools menu (via
  7729. Options/Tools).
  7730.  
  7731.        Name:       GNU Pascal
  7732.        Path:       gpc
  7733.        Arguments:  $SAVE ALL --verbose -Q $NAME($EDNAME).pas
  7734.        HotKey:     Shift+F9
  7735.  
  7736.    Note once more that GPC is case-sensitive, so it is important to
  7737. specify `.pas' instead of the `.PAS' Borland Pascal would append
  7738. otherwise!
  7739.  
  7740.    You can include more command-line arguments to GNU Pascal (e.g.
  7741. `--automake'; see below) as you will learn more about them below.
  7742.  
  7743.    Because Borland Pascal will try to recompile your program if you use
  7744. its `run' menu function, you will need another "tool" to run your
  7745. program:
  7746.  
  7747.        Name:       run program
  7748.        Path:       command.com
  7749.        Arguments:  /c $NAME($EDNAME)
  7750.        HotKey:     Shift+F10
  7751.  
  7752. 
  7753. File: ^.!gcc.docs.pascal.gpc,  Node: Comments and compiler directives,  Next: Units; GPI files and AutoMake,  Prev: There is no IDE!,  Up: Borland Pascal
  7754.  
  7755. Comments and compiler directives
  7756. ================================
  7757.  
  7758.    According to ISO 7185 and ISO 10206 standard, GNU Pascal recognizes
  7759. by default comments opened with `(*' and closed with `}'.  With Borland
  7760. Pascal, both types of comments can be nested, so you will probably have
  7761. sources where passages containing comments are "commented out".
  7762.  
  7763.    To use this with GPC, you have to "switch on" nested comments either
  7764. by a command-line option, or by a compiler directive:
  7765.  
  7766.        --nested-comments            {$N+}    (*$N+*)
  7767.  
  7768.    The $N directive also exists in BP but has another meaning.  The
  7769. same holds for most of GPC's other compiler directives (also
  7770. corresponding to command-line options in most cases):
  7771.  
  7772.        --short-circuit     $B+ $B-  like in Borland Pascal:
  7773.                                     $B- means short-circuit Boolean
  7774.                                     operators; $B+ complete evaluation
  7775.      
  7776.        --c-numbers         $C+ $C-  enable/disable C-style octal 0177
  7777.                                     and hexadecial 0xFF numbers
  7778.      
  7779.        --char-escapes      $E+ $E-  enable/disable C-style character
  7780.                                     escape sequences in strings
  7781.      
  7782.        --nested-comments   $N+ $N-  see above
  7783.      
  7784.        --pedantic          $P+ $P-  give/don't give warnings about
  7785.                                     violations of ISO 7185
  7786.                                     Standard Pascal
  7787.      
  7788.                            $W+ $W-  enable/disable warnings
  7789.      
  7790.                            $X+ $X-  enable/disable extended syntax
  7791.                                     (function return value ignore,
  7792.                                     operator definitions)
  7793.      
  7794.        {$I FileName }               include filename.pas or
  7795.                                     filename.p (make it lowercase)
  7796.      
  7797.        {$include "filename.pas"}    include (case-sensitive)
  7798.      
  7799.        {$include <filename.pas>}    the same, but don't search in
  7800.                                     current directory
  7801.      
  7802.        {$M Hello!}                  write message "Hello!" to error
  7803.                                     device during compilation
  7804.      
  7805.        {$D GNU}                     define GNU (for conditional
  7806.        {$define GNU}                compilation)
  7807.      
  7808.        -D GNU                       the same in command line
  7809.      
  7810.        {$D loop while true do}      define "loop" to be "while
  7811.                                     true do" as a macro like in C.
  7812.                                     It is case-sensitive.
  7813.      
  7814.        {$ifdef GNU}                 conditional compilation
  7815.          ...                        (like in Borland Pascal).
  7816.        {$else}                      GPC predefines the symbol
  7817.          ...                        __GPC__ (with two leading
  7818.        {$endif}                     and trailing underscores).
  7819.  
  7820.    You also can use C-style preprocessor directives, e.g. #include.
  7821.  
  7822.    As in Borland Pascal, `{$...}' and `(*$...*)' are equivalent.
  7823.  
  7824. 
  7825. File: ^.!gcc.docs.pascal.gpc,  Node: Units; GPI files and AutoMake,  Next: Optimization,  Prev: Comments and compiler directives,  Up: Borland Pascal
  7826.  
  7827. Units, GPI files and AutoMake
  7828. =============================
  7829.  
  7830.    You can use Units in the same way as in Borland Pascal.  However,
  7831. there are some differences, problems and new features.  (Please report
  7832. the bug if something doesn't work.)
  7833.  
  7834.    Concerning the syntax of a Unit, you can, if you want, use Extended
  7835. Pascal syntax to specify a Unit initializer, i.e.  instead of writing
  7836.  
  7837.        begin
  7838.          ...
  7839.        end.
  7840.  
  7841. at the end of the Unit, you can get the same result with
  7842.  
  7843.        to begin do
  7844.          begin
  7845.            ...
  7846.          end (* to begin *);
  7847.  
  7848. and there also exists
  7849.  
  7850.        to end do
  7851.          begin
  7852.            ...
  7853.          end (* to end *);
  7854.  
  7855.    which specifies a finalization routine.  Use this instead of Borland
  7856. Pascal's exit procedures.  You also can specify an order in which
  7857. initializers are run--see *Note Extensions:: and *Note Extended
  7858. Pascal:: for more about this.  There you can also find information
  7859. about Extended Pascal Modules, an alternative to Units.
  7860.  
  7861.    At the moment, there are no qualified identifiers, so take care
  7862. about name clashes between different Units.
  7863.  
  7864.    When GPC compiles a Unit, it produces two files: an `.o' object file
  7865. (compatible with other GNU compilers such as GNU C) plus a precompiled
  7866. Interface which resides in a `.gpi' file.
  7867.  
  7868.    GPC does not automatically recognize that something is a Unit and
  7869. cannot be linked; you have to tell this by a command line switch:
  7870.  
  7871.        -c            only compile, don't link.
  7872.  
  7873.    For example, to compile two units, use:
  7874.  
  7875.        gpc -c myunit1.pas myunit2.pas
  7876.  
  7877.    Of course, one of the purposes of writing Units is to compile them
  7878. separately.  However, GNU Pascal allows you to have one or more Units
  7879. in the same source file (producing only one `.o' file but separate
  7880. `.gpi' files).  You even can have a Program and Units in one and the
  7881. same source file; in this case, no `.o' file at all is produced.
  7882.  
  7883.    You can use the above as a workaround (*$include the Unit *) in case
  7884. something goes wrong with the .gpi mechanism.  (It is a new feature in
  7885. GPC 2.7.2 and may be unstable.)
  7886.  
  7887.    When you have all Units compiled and want to compile the Program,
  7888. specify the `.o' files in the command line:
  7889.  
  7890.        gpc hallo.pas myunit1.o myunit2.o
  7891.  
  7892.    You also can specify the program and the units in one command line:
  7893.  
  7894.        gpc hallo.pas myunit1.pas myunit2.pas
  7895.  
  7896.    As an alternative to manually compiling and specifying object files,
  7897. you can use GPC's AutoMake feature.  (WARNING: This is a new feature in
  7898. GPC 2.7.2 and may be unstable!)  With an additional command-line
  7899. argument
  7900.  
  7901.        gpc --automake hallo.pas
  7902.  
  7903.    GPC tries to behave like Borland Pascal's `make' facility and
  7904. automatically recompiles Units the source of which has been changed.
  7905. It also works if an included file has been changed.
  7906.  
  7907.    To pass arguments to the compilation of Units, specify them in a
  7908. string surrounded by quotation marks after `--automake='.  For example,
  7909. if you want to give the `--verbose' argument not only at top level but
  7910. also for (re)compilation of Units, use:
  7911.  
  7912.        gpc --verbose --automake="--verbose" hallo.pas
  7913.  
  7914. 
  7915. File: ^.!gcc.docs.pascal.gpc,  Node: Optimization,  Next: Debugging,  Prev: Units; GPI files and AutoMake,  Up: Borland Pascal
  7916.  
  7917. Optimization
  7918. ============
  7919.  
  7920.    GNU Pascal is a 32 bit compiler with excellent optimization
  7921. algorithms (which are identically the same as those of GNU C).  There
  7922. are three official optimization levels, specified by the command line
  7923. options `-O', `-O2', and `-O3'.  Actually, this goes up to `-O6', but
  7924. levels above `-O3' are experimental (as far as I know).
  7925.  
  7926.    One example:
  7927.  
  7928.        Program Test;
  7929.      
  7930.        Var
  7931.          A, B: Integer;
  7932.      
  7933.        begin
  7934.          A:= 3;
  7935.          B:= 4;
  7936.          writeln ( A + B );
  7937.        end.
  7938.  
  7939.    When GNU Pascal compiles this program with optimization, it
  7940. recognizes that the argument of writeln is the constant 7--and
  7941. optimizes away the variables `A' and `B'.
  7942.  
  7943.    For more about optimization, see the GNU C documentation.
  7944.  
  7945. 
  7946. File: ^.!gcc.docs.pascal.gpc,  Node: Debugging,  Next: GPC inline assembler,  Prev: Optimization,  Up: Borland Pascal
  7947.  
  7948. Debugging
  7949. =========
  7950.  
  7951.    The command line option `-g' specifies generation of debugging
  7952. information for GDB, the GNU debugger.  GDB is not as comfortable as
  7953. the Turbo Debugger, but it has the same abilities but one:  The program
  7954. being debugged is slowed down.  For more information about GDB, call it
  7955. with `gdb' and type in the `help' command.
  7956.  
  7957.    GDB has one very nice feature which might even make up for the
  7958. slowing-down problematic:  When a GNU-compiled program crashes, it puts
  7959. out a `core' file.  When you say "target core core" to the GNU
  7960. debugger, it reads the core file and can tell you the address of the
  7961. crash, the contents of variables and of the stack, and so on.
  7962.  
  7963.    Sometimes it is nice to have a look at the assembler output of the
  7964. compiler.  When you specify the `-S' command line option, GPC produces
  7965. an `.s' file instead of an `.o' file which contains assembler source
  7966. for your program.  More about this in the next section.
  7967.  
  7968. 
  7969. File: ^.!gcc.docs.pascal.gpc,  Node: GPC inline assembler,  Next: Objects,  Prev: Debugging,  Up: Borland Pascal
  7970.  
  7971. GPC inline assembler
  7972. ====================
  7973.  
  7974.    GNU Pascal has an inline assembler, but it is quite different from
  7975. Borland's one.  I have not yet found reasonable documentation about the
  7976. use of this assembler, but I found out the following:
  7977.  
  7978.    The syntax is
  7979.  
  7980.        asm ( 'movl $12345678, %eax' );
  7981.        asm ( 'movl %eax, %edx' );
  7982.  
  7983.    to move the (hex) value `$12345678' to the EAX register and then to
  7984. the EDX register.  The String argument of the asm "procedure" is passed
  7985. as a string to the assembler stage of the compilation.  Note that the
  7986. order of operands is reversed with respect to the order you know from
  7987. other Intel assemblers and that the size of the arguments is appended
  7988. to the mnemonic as a suffix b (byte), w (word = 2 bytes), or l (long =
  7989. 4 bytes).
  7990.  
  7991.    You can learn about the GNU assembler syntax when compiling your
  7992. program with `-S' (see above) and looking into the resulting assembler
  7993. source.
  7994.  
  7995.    To access Pascal symbols from the assembler, do something like
  7996.  
  7997.        asm ( 'movl %%eax, %0' : : 'rm' ( MyVariable ) );
  7998.  
  7999.    Here, the % signs in front of the register names are doubled because
  8000. % gets some special meaning.  The 'rm' means that the operand may be in
  8001. a register or in memory.
  8002.  
  8003.    (If somebody knows more about the GNU assembler syntax, please,
  8004. please, please explain it to me or point me to some reasonable
  8005. documentation about it! <peter.gerwinski@uni-essen.de>)
  8006.  
  8007. 
  8008. File: ^.!gcc.docs.pascal.gpc,  Node: Objects,  Next: Strings,  Prev: GPC inline assembler,  Up: Borland Pascal
  8009.  
  8010. Objects
  8011. =======
  8012.  
  8013.    Objects in the Borland Pascal 7.0 notation are implemented into GNU
  8014. Pascal with the following differences:
  8015.  
  8016.    * the "private" directive does not work,
  8017.  
  8018.    * data fields and methods may be mixed:
  8019.             MyObj = object
  8020.               x: Integer;
  8021.               Procedure Foo; virtual;
  8022.               y: Real;
  8023.               Function Bar: Char;
  8024.             end (* MyObj *);
  8025.  
  8026. 
  8027. File: ^.!gcc.docs.pascal.gpc,  Node: Strings,  Next: Typed constants,  Prev: Objects,  Up: Borland Pascal
  8028.  
  8029. Strings
  8030. =======
  8031.  
  8032.    Strings are "Schema types" in GNU Pascal which is something more
  8033. complicated than Borland-style strings.  For variables, you cannot
  8034. specify just `String' as a type (always specify the maximum length);
  8035. for parameters you can.  There is no 255 length limit.  According to
  8036. Extended Pascal, the maximum string length must be in (parantheses);
  8037. GNU Pascal accepts [brackets], however.
  8038.  
  8039.    For more about Strings and Schema types see *Note Extensions:: and
  8040. *Note Extended Pascal::.
  8041.  
  8042.    String-handling functions (see *Note Extensions::) are different in
  8043. both dialects but can approximately be mapped on each other:
  8044.  
  8045.        Borland Pascal          GNU Pascal
  8046.      
  8047.        length                  length
  8048.        Pos                     Index
  8049.        Str                     WriteStr
  8050.        Val                     ReadStr
  8051.        Copy                    SubStr, MyStr [ 2..7 ]
  8052.        MyStr [ 0 ]:= #7;       Trim
  8053.          -                     EQ, NE, LT, LE, GT, GE
  8054.        Insert                    -
  8055.        Delete                    -
  8056.  
  8057.    It should not be difficult to write a compatibility Unit--if you do
  8058. so, please send it to us!
  8059.  
  8060. 
  8061. File: ^.!gcc.docs.pascal.gpc,  Node: Typed constants,  Next: Bit; byte and memory manipulation,  Prev: Strings,  Up: Borland Pascal
  8062.  
  8063. Typed constants
  8064. ===============
  8065.  
  8066.    GNU Pascal supports Borland Pascal's "typed constants" but also
  8067. Extended Pascal's initialized variables:
  8068.  
  8069.        Var
  8070.          x: Integer value 7;
  8071.  
  8072.    When a typed constant is misused as an initialized variable, a
  8073. warning is given.
  8074.  
  8075.    Initialization of structured variables (typed constants) is not yet
  8076. stable.
  8077.  
  8078.    When you want a local variable to preserve its value, define it as
  8079. `__static__' instead of using a typed constant:
  8080.  
  8081.        Procedure Foo;
  8082.      
  8083.        Var
  8084.          x: __static__ Real;
  8085.      
  8086.        begin (* Foo *)
  8087.          (* x keeps its value between two calls to this Procedure *)
  8088.        end (* Foo *);
  8089.  
  8090.    Remark: If you don't like underscores, you can use the (*$define *)
  8091. mechanism to get rid of them:
  8092.  
  8093.        (*$define static __static__ *)
  8094.  
  8095. 
  8096. File: ^.!gcc.docs.pascal.gpc,  Node: Bit; byte and memory manipulation,  Next: User-defined operators,  Prev: Typed constants,  Up: Borland Pascal
  8097.  
  8098. Bit, byte and memory manipulation
  8099. =================================
  8100.  
  8101.    The (non-standard) bitwise operators `shl', `shr', `and', `or',
  8102. `xor' work in GNU Pascal like in Borland Pascal.  As an extension, you
  8103. can use them as "procedures", for examples
  8104.  
  8105.        and ( x, $0000FFFF );
  8106.  
  8107.    as an alternative to
  8108.  
  8109.        x:= x and $0000FFFF;
  8110.  
  8111.    Instead of the Borland-specific notation `$ABCD' for hexadecimal
  8112. numbers you also can use Extended Pascal notation:
  8113.  
  8114.         2#11111111   for a binary,
  8115.         8#177        for an octal,
  8116.        16#FF         for a hexadecimal number,
  8117.  
  8118.    and so on up to a basis of 36.
  8119.  
  8120.    Inc and dec are implemented like in Borland Pascal; pred and succ
  8121. are generalized according to Extended Pascal:
  8122.  
  8123.        a:= succ ( a, 5 );
  8124.  
  8125.    Absolute variables work only in the context of overloading with
  8126. other variables, not in the context of specifying an absolute address.
  8127. The Mem and Port arrays don't exist in GNU Pascal.
  8128.  
  8129.    Borland Pascal's procedures `FillChar' and `move' are not built-in
  8130. into GNU Pascal.  However, you can write them by yourself using untyped
  8131. Var parameters (see Sec. `Data types').
  8132.  
  8133. 
  8134. File: ^.!gcc.docs.pascal.gpc,  Node: User-defined operators,  Next: Data types,  Prev: Bit; byte and memory manipulation,  Up: Borland Pascal
  8135.  
  8136. User-defined operators
  8137. ======================
  8138.  
  8139.    GNU Pascal allows the user to define operators according to the
  8140. Pascal-SC syntax:
  8141.  
  8142.        (*$X+*)
  8143.      
  8144.        Type
  8145.          Point = record
  8146.            x, y: Real;
  8147.          end (* Point *);
  8148.      
  8149.        Operator + ( a, b: Point ) c: Point;
  8150.      
  8151.        begin (* Point + Point *)
  8152.          c.x:= a.x + b.x;
  8153.          c.y:= a.y + b.y;
  8154.        end (* Point + Point *);
  8155.  
  8156.    It is necessary to enable "extended syntax" `(*$X+*)' when defining
  8157. operators.
  8158.  
  8159.    The Pascal-SC operators `+>', `+<', etc. for exact numerical
  8160. calculations are not implemented, but you can define them.  If you
  8161. write a module which really implements these operators, please send it
  8162. to us, so we can include it into the next distribution.
  8163.  
  8164.    (And if you know more about modules in Pascal-SC than just their
  8165. existence, please contact us either!  We could probably easily
  8166. implement them if we knew how they look like.  Something quite close to
  8167. Pascal-SC modules already *is* implemented as "GNU specific modules".)
  8168.  
  8169. 
  8170. File: ^.!gcc.docs.pascal.gpc,  Node: Data types,  Next: Files,  Prev: User-defined operators,  Up: Borland Pascal
  8171.  
  8172. Data types
  8173. ==========
  8174.  
  8175.    * Generic Pointer:  There is no built-in untyped Pointer in GNU
  8176.      Pascal.  Use `^Void' to define it.
  8177.  
  8178.    * Integer types:  There is no built-in Byte, Word, etc. in GNU
  8179.      Pascal.  Use the modifiers `__byte__', `__short__', `__long__' and
  8180.      `__unsigned__' (described in *Note Extensions::) to define them.
  8181.  
  8182.             Borland Pascal          GNU Pascal
  8183.           
  8184.             __byte__ Integer
  8185.             Integer                 __short__ Integer
  8186.             LongInt                 Integer = __long__ Integer
  8187.             Comp                    __longlong__ Integer
  8188.             Byte                    __unsigned__ __byte__ Integer
  8189.             Word                    __unsigned__ __short__ Integer
  8190.               -                     __unsigned__ __long__ Integer
  8191.               -                     __unsigned__ __longlong__ Integer
  8192.  
  8193.      Real types: There is no built-in `Single', `Double', `Extended' in
  8194.      GNU Pascal; Real has 8 bytes on an Intel-x86 machine.  Use
  8195.      `__short__ Real' to define `Single', `__long__ Real' to define
  8196.      `Extended'.
  8197.  
  8198.             Borland Pascal          GNU Pascal
  8199.           
  8200.             Single                  __short__ Real
  8201.             Real                      -
  8202.             Double                  Real
  8203.             Extended                __long__ Real
  8204.             Comp                    __longlong__ Integer
  8205.  
  8206.    * Complex numbers:  According to Extended Pascal, GNU Pascal has
  8207.      built-in complex numbers.
  8208.  
  8209.    * Instead of procedural types, GNU Pascal has pointers to procedures:
  8210.  
  8211.               Type
  8212.                 FuncPtr = ^Function ( Real ): Real;
  8213.  
  8214.      Furthermore, GNU Pascal supports Standard Pascal's procedural
  8215.      parameters--see below.
  8216.  
  8217. 
  8218. File: ^.!gcc.docs.pascal.gpc,  Node: Files,  Next: Built-in constants,  Prev: Data types,  Up: Borland Pascal
  8219.  
  8220. Files
  8221. =====
  8222.  
  8223.    * GNU Pascal no built-in `Assign' procedure for files, but you can
  8224.      write it by yourself using the "Bind" mechanism of Extended Pascal:
  8225.  
  8226.             Procedure Assign ( Var T: Text; Name: String );
  8227.           
  8228.             Var
  8229.               B: BindingType;
  8230.           
  8231.             begin (* Assign *)
  8232.               unbind ( T );
  8233.               B:= binding ( T );
  8234.               B.Name:= Name;
  8235.               bind ( T, B );
  8236.               B:= binding ( T );
  8237.             end (* Assign *);
  8238.  
  8239.    * GNU Pascal has no untyped files, "BlockRead", or "BlockWrite".
  8240.  
  8241. 
  8242. File: ^.!gcc.docs.pascal.gpc,  Node: Built-in constants,  Next: Built-in operators,  Prev: Files,  Up: Borland Pascal
  8243.  
  8244. Built-in constants
  8245. ==================
  8246.  
  8247.    * Pi constant:  not built-in.  Use Pi = 3.14159265358979323846.
  8248.  
  8249.    * Other built-in constants:  GNU Pascal has `MaxInt', `MaxChar',
  8250.      `MaxReal', and `MinReal', but no `MaxLongInt'.
  8251.  
  8252. 
  8253. File: ^.!gcc.docs.pascal.gpc,  Node: Built-in operators,  Next: Built-in Procedures and Functions,  Prev: Built-in constants,  Up: Borland Pascal
  8254.  
  8255. Built-in operators
  8256. ==================
  8257.  
  8258.    * Exponentiation:  According to Extended Pascal, GNU Pascal supports
  8259.      exponentiation operators `pow' and `**' which do not exist in
  8260.      Borland Pascal.  You can use `x pow y' for integer and `x ** y'
  8261.      for real or complex exponents; the basis may be integer, real or
  8262.      complex in both cases.
  8263.  
  8264.    * Address operator: GNU Pascal accepts Borland's `@', but also `&'
  8265.      as an address operator.
  8266.  
  8267.    * GNU Pascal has a symmetric set difference operator `set1 >< set2'.
  8268.      See *Note Extensions:: for more about this.
  8269.  
  8270. 
  8271. File: ^.!gcc.docs.pascal.gpc,  Node: Built-in Procedures and Functions,  Next: Parameters,  Prev: Built-in operators,  Up: Borland Pascal
  8272.  
  8273. Built-in Procedures and Functions
  8274. =================================
  8275.  
  8276.    * `Write' and `writeln' default behaviour:  The numeric default
  8277.      format of "write" and "writeln" differs between both Pascal
  8278.      dialects.  The standard format of GNU Pascal is a field of length
  8279.      14 for real, and a field of length 10 for integer values, while
  8280.      Borland Pascal begins just left by default.  An explicit
  8281.      fieldlength of zero causes GNU Pascal to omit the output; in
  8282.      Borland Pascal it yields the default.
  8283.  
  8284.    * `GetMem' and `FreeMem':  `GetMem' can also act as a function in
  8285.      GNU Pascal:
  8286.  
  8287.             p:= GetMem ( 1024 );
  8288.  
  8289.      The second parameter to FreeMem is ignored by GNU Pascal and may
  8290.      be omitted.  Memory blocks are always freed with the same size
  8291.      they were allocated with.
  8292.  
  8293.      Remark:  Extended Pascal Schema types will provide a cleaner
  8294.      approach to most of the applications of `GetMem' and `FreeMem' in
  8295.      the future.
  8296.  
  8297.    * `Min' and `max':  GNU Pascal has built-in `min' and `max'
  8298.      functions (two arguments) which work for all ordinal types
  8299.      (`Integer', `Char', ...) plus `Real'.
  8300.  
  8301.    * `UpCase' function:  not built-in.
  8302.  
  8303.    * `Lo', `Hi', `Swap' functions:  not built-in.
  8304.  
  8305. 
  8306. File: ^.!gcc.docs.pascal.gpc,  Node: Parameters,  Next: Miscellaneous,  Prev: Built-in Procedures and Functions,  Up: Borland Pascal
  8307.  
  8308. Parameters
  8309. ==========
  8310.  
  8311.    * Untyped Var parameters are denoted by
  8312.  
  8313.             Procedure Foo ( Var x: Void );
  8314.  
  8315.      in GNU Pascal instead of
  8316.  
  8317.             Procedure Foo ( Var x );
  8318.  
  8319.      in Borland Pascal.
  8320.  
  8321.    * GNU Pascal defines "ellipsis" parameters vor variable argument
  8322.      lists,
  8323.  
  8324.             Procedure Foo ( a: Integer; ... );
  8325.  
  8326.      but does not (yet) provide a portable mechanism to access the
  8327.      additional arguments.
  8328.  
  8329.    * Structured function return values:  According to Extended Pascal,
  8330.      GNU Pascal allows structured function return values.
  8331.  
  8332.    * Open array parameters are partially implemented:  They work, but a
  8333.      warning is given. However, Standard Pascal conformant array
  8334.      parameters (also partially implemented) are a "cleaner" mechanism
  8335.      to pass arrays of variable size.
  8336.  
  8337.    * GNU Pascal supports Standard Pascal's procedural parameters:
  8338.  
  8339.             Procedure DrawGraph ( f: Function ( Real ): Real );
  8340.  
  8341. 
  8342. File: ^.!gcc.docs.pascal.gpc,  Node: Miscellaneous,  Prev: Parameters,  Up: Borland Pascal
  8343.  
  8344. Miscellaneous
  8345. =============
  8346.  
  8347.    * Headlines:  According to Extended Pascal, a Program headline must
  8348.      contain the program's parameters:
  8349.  
  8350.               Program Foo ( Input, Output );
  8351.  
  8352.      In GNU Pascal, headline parameters are optional.  If the headline
  8353.      is omitted, a warning is given.
  8354.  
  8355.    * Case statements:  In a case statement, GNU Pascal has `otherwise'
  8356.      instead of `else' (according to Extended Pascal):
  8357.  
  8358.             case x of
  8359.               1: writeln ( 'one' );
  8360.               2: writeln ( 'two' );
  8361.               otherwise: writeln ( 'many' );
  8362.             end (* case *);
  8363.  
  8364.      If there are two ore more statements following `otherwise', they
  8365.      must be grouped with `begin' and `end'.
  8366.  
  8367.    * Char constants: Chars like `#13' or `^M' are not implemented into
  8368.      GNU Pascal.
  8369.  
  8370.    * Sets: GNU Pascal has a `card ( myset )' function for sets which
  8371.      counts their elements.
  8372.  
  8373.    * Inline:  GNU Pasccal allows "inline" Procedures and Functions,
  8374.      while Borland Pascal only allows machine code to be inline:
  8375.  
  8376.      Borland Pascal:
  8377.  
  8378.             Function Max ( x, y: Integer ): Integer;
  8379.             Inline ( $58 / $59 / $3B / $C1 / $7F / $01 / $91 );
  8380.  
  8381.      GNU Pascal:
  8382.  
  8383.             Inline Function Max ( x, y: Integer ): Integer;
  8384.           
  8385.             begin (* Max *)
  8386.               if x > y then
  8387.                 Max:= x
  8388.               else
  8389.                 Max:= y;
  8390.             end (* Max *);
  8391.  
  8392.      (Actually, a more general Max is already built-in.)
  8393.  
  8394.      This feature is not so important as it might seem because in
  8395.      optimization level 3 (see above), GNU Pascal automatically
  8396.      "inlines" short Procedures and Functions.
  8397.  
  8398. 
  8399. File: ^.!gcc.docs.pascal.gpc,  Node: GPC Bugs,  Next: How to Contribute,  Prev: FPK Pascal,  Up: Top
  8400.  
  8401. Known bugs and how to report bugs
  8402. *********************************
  8403.  
  8404.    If you encounter a bug with GPC, please check whether it is one of
  8405. the known bugs.  If not, report it to the GNU Pascal mailing list
  8406. `gpc@hut.fi'.  (But always report it if you solve the problem! ;-)
  8407.  
  8408. Known bugs
  8409. ==========
  8410.  
  8411.    The GPC compiler does not yet implement the whole ISO 7185 Pascal
  8412. standard, so please take this into account when you consider using this
  8413. for any purpose.
  8414.  
  8415.    See the file `version.c' to find out the version number of this GPC
  8416. (or run `gpc -v')
  8417.  
  8418.    Problems in this GPC version:
  8419.  
  8420.    * High optimization levels do not work properly on the Alpha.  Some
  8421.      conformance tests FAIL when compiled with -O6 flag, which means
  8422.      that the compiler generates invalid code. Don't use this flag in
  8423.      the alpha before the problem gets fixed.  It might have something
  8424.      to do with automatic inlining, but I have not yet looked at this.
  8425.      -O flag should be ok.  (Also take care when using explicit inline
  8426.      functions)
  8427.  
  8428.    * For some reason the pascal main program does not get lineno stabs
  8429.      -> It is hard to debug it with gdb...
  8430.  
  8431.    * The modules export everything, not just the stuff in the export
  8432.      interfaces. However, the unexported variables and functions are
  8433.      invisible to modules in other files.
  8434.  
  8435.    * type checking is mostly what C does, not what Pascal requires, so
  8436.      GPC does not yet implement a strongly typed language.  Although
  8437.      correct programs compile, incorrect ones compile also.
  8438.  
  8439.    * run time errors are not checked.
  8440.  
  8441.    * the inline set operations have some problems with operations on
  8442.      two sets if the sets do not contain equally many segments.
  8443.  
  8444.    * In addition, the set code generated in the alpha causes runtime
  8445.      runtime errors in the generated code.
  8446.  
  8447.    * Conformant arrays don't yet work (in general).  Until they do,
  8448.      this is a LEVEL-0 compiler.
  8449.  
  8450. Inconveniences
  8451. ==============
  8452.  
  8453.    * NEW & DISPOSE optional tag field arguments are ignored (warning
  8454.      given, code works)
  8455.  
  8456.    * GDB does not yet understand pascal sets, files or subranges.  Now
  8457.      GDB allows you to debug these things, even though it does not yet
  8458.      understand some stabs.
  8459.  
  8460.    * PACKED does not pack. (implementation dependent, warning given,
  8461.      code works)
  8462.  
  8463.    * Files of integer subranges that would fit in a byte do not;
  8464.      instead they are handled as files of integer.  This is especially
  8465.      annoying with "file of 0..255".
  8466.  
  8467. Notes for debugging
  8468. ===================
  8469.  
  8470.    * Forward referencing pointers generate DBX style debugging symbols
  8471.      by outputting the `.stabs' as an unknown pointer and later it just
  8472.      outputs the same `.stabs' again, but this time it also tells what
  8473.      type the pointer points to.  This seems to work for gdb. As of
  8474.      this writing I have not checked what happens with SDB type
  8475.      debugging info.  It might be that the pointer is left to be a
  8476.      `(void *)' pointer, so you have to cast it in order to output the
  8477.      object the pointer points to.
  8478.  
  8479.      Also, I have not tried any other debugger than gdb.  If you do,
  8480.      please let me know what happens.
  8481.  
  8482.      I think that GDB does not yet support the kind of `.stabs' that
  8483.      should be used to do this correctly:
  8484.  
  8485.             .stabs ":tANUMBER=BNUMBER", WHATEVER
  8486.  
  8487.      where ANUMBER is the unknown pointer type referenced earlier, and
  8488.      the BNUMBER is the type which ANUMBER actually is. This construct
  8489.      is not required in C.
  8490.  
  8491.    * When debugging, please note that the Initial Letter In Each
  8492.      Identifier Is In Upper Case And The Rest Are In Lower Case. If
  8493.      you wish to call C-routines declare them with the "C" directive,
  8494.      as follows:
  8495.  
  8496.           Procedure FooBAR(i:integer);c;
  8497.  
  8498.      This makes the external name to be `_foobar' (replace `_' with you
  8499.      machine prefix.)
  8500.  
  8501.           Procedure FooBAR(i:Integer); External;
  8502.  
  8503.      Uses external name `_Foobar'.
  8504.  
  8505.      It is done like this to reduce name clashes with `libc.a' and
  8506.      other possible libraries.
  8507.  
  8508.    * All visible GPC runtime system library routines are named `_p_...'.
  8509.  
  8510.    * However, the main program name is not capitalized.  (this is a
  8511.      kludge -> it may now clash with libc  identifiers. We'll change
  8512.      this somehow later)
  8513.  
  8514. 
  8515. File: ^.!gcc.docs.pascal.gpc,  Node: How to Contribute,  Next: Index,  Prev: GPC Bugs,  Up: Top
  8516.  
  8517. How *you* can contribute to GNU Pascal
  8518. **************************************
  8519.  
  8520.    Below you can find a list of jobs which should be done for
  8521. GNU-Pascal.  In cases where somebody is already working on it, the name
  8522. of that person is written behind the job's description together with
  8523. the status of the project; e-mail addresses are given below.
  8524.  
  8525.    If there is already a name behind a job, this does *not* mean that
  8526. you shouldn't do that but just that you should get in contact with that
  8527. person if you would like to contribute to that field.
  8528.  
  8529.    Welcome to the GNU Pascal development team!
  8530.  
  8531. List of jobs
  8532. ============
  8533.  
  8534.      Overall coordination                    Juki                works ;-)
  8535.      Coordination with GCC developers        Juki                 ?
  8536.      Merge into GCC main distribution        Juki                 ?
  8537.      
  8538.      ISO 7185 Standard Pascal                Juki                works
  8539.      ISO 10206 Extended Pascal               Juki                90%
  8540.      Object Pascal                            ?
  8541.      Borland Pascal 7.0                      Peter               80%
  8542.      Delphi                                   ?
  8543.      Pascal-SC                               Peter               please help!
  8544.      Compiler options to force one standard  Peter               planned
  8545.      
  8546.      EMX version (DOS and OS/2)              Peter               works
  8547.      Linux binaries                          Peter               works
  8548.      DJ version (DOS)                        JanJaap             works
  8549.      Win32 version                           JanJaap             70%
  8550.      Cross compilers Linux -> others         JanJaap             works
  8551.      
  8552.      Installation instructions               Larry                ?
  8553.      Documentation                           Larry                ?
  8554.      
  8555.      Type checking                           Juki                 ?
  8556.      Automatic make                          Peter               works
  8557.      Objects: C++ code compatibility          ?
  8558.      PXSC module syntax                      Peter               planned
  8559.      Procedure overloading                   Peter               planned
  8560.      Precompiled module interfaces           Peter               works
  8561.      
  8562.      Run time system                         Juki                works
  8563.      I/O error handling                       ?
  8564.      Turbo compatible DOS, CRT, Graph, ...    ?                  ask Peter
  8565.      Turbo Vision compatible library          ?
  8566.      POSIX library (replacement for DOS)     Berend              to be ported
  8567.      Replacement for (parts of) CRT          Peter               beta (BO5)
  8568.      Replacement for Graph                   Peter               planned (BO5)
  8569.      Replacement for Turbo Vision            Peter               planned (BO5)
  8570.      
  8571.      Port of the RHIDE IDE                   JanJaap              ?
  8572.      Improvement of the XWPE IDE              ?
  8573.  
  8574. List of contributors (in alphabetical order)
  8575. ============================================
  8576.  
  8577.      Berend              Berend de Boer, Nederlands
  8578.                          <100120.3121@compuserve.com>
  8579.      
  8580.      JanJaap             Jan Jaap van der Heijden, Nederlands
  8581.                          <j.j.vanderheijden@student.utvente.nl>
  8582.      
  8583.      Juki                Jukka Virtanen, Finland
  8584.                          <jtv@hut.fi>
  8585.      
  8586.      Larry               Larry Carter, USA
  8587.                          <lcarter@powerslave.jf.intel.com>
  8588.      
  8589.      Peter               Peter Gerwinski, Germany
  8590.                          <peter.gerwinski@uni-essen.de>
  8591.  
  8592. 
  8593. File: ^.!gcc.docs.pascal.gpc,  Node: FPK Pascal,  Next: GPC Bugs,  Prev: Borland Pascal,  Up: Top
  8594.  
  8595. FPK Pascal and GNU Pascal--a comparision
  8596. ****************************************
  8597.  
  8598.    by Florian Klaempfl <fnklaem@cip.ft.uni-erlangen.de>
  8599. and Peter Gerwinski <peter.gerwinski@uni-essen.de>
  8600. 7. July 1996
  8601.  
  8602.                   FPK Pascal                       GNU Pascal
  8603.                   ----------                       ----------
  8604.      
  8605.      aim:         free Borland compatible          free portable
  8606.                   32-bit Pascal compiler           32-bit Pascal compiler
  8607.      
  8608.      version:     0.6.4                            2.6.3
  8609.      
  8610.      operating    DOS (DJ), OS/2                   DOS, OS/2 (EMX)
  8611.      systems:                                      DOS (DJ)
  8612.                                                    arbitrary UNIX systems
  8613.      
  8614.      written in:  Pascal, TP Syntax                C
  8615.                   (compiles itself)
  8616.      
  8617.      source:      900 kB                           2.8 MB
  8618.                                                    plus source of GCC (8 MB)
  8619.      
  8620.      language     Borland Pascal 7.0,              ISO 7185, ISO 10206,
  8621.      standard:    (parts of) Delphi II             (most of) Borland Pascal 7.0
  8622.      
  8623.      extensions:  function overloading             operators
  8624.      
  8625.      home server: http://www.brain.uni-freiburg.de ftp://kampi.hut.fi/jtv/gnu-pascal
  8626.      
  8627.      license:     FreeWare (GPL)                   FreeWare (GPL)
  8628.      
  8629.      author:      Florian Klaempfl, Germany        Jukka Virtanen, Finland
  8630.                   fnklaem@cip.ft.uni-erlangen.de   jtv@hut.fi
  8631.  
  8632. 
  8633. File: ^.!gcc.docs.pascal.gpc,  Node: Index,  Prev: How to Contribute,  Up: Top
  8634.  
  8635. Index
  8636. *****
  8637.  
  8638. * Menu:
  8639.  
  8640. * -lgcc, use with -nodefaultlibs:       Link Options.
  8641. * -lgcc, use with -nostdlib:            Link Options.
  8642. * -nodefaultlibs and unresolved references: Link Options.
  8643. * -nostdlib and unresolved references:  Link Options.
  8644. * gprof:                                Debugging Options.
  8645. * longjmp warnings:                     Warning Options.
  8646. * prof:                                 Debugging Options.
  8647. * tcov:                                 Debugging Options.
  8648. * stdarg.h and RT PC:                   RT Options.
  8649. * varargs.h and RT PC:                  RT Options.
  8650. * Alpha OSF/1:                          Alpha OSF/1.
  8651. * AMD29K options:                       AMD29K Options.
  8652. * arguments in frame (88k):             M88K Options.
  8653. * ARM options:                          ARM Options.
  8654. * assembler syntax, 88k:                M88K Options.
  8655. * Bison parser generator:               UNIX.
  8656. * bit shift overflow (88k):             M88K Options.
  8657. * byte writes (29k):                    AMD29K Options.
  8658. * code generation conventions:          Code Gen Options.
  8659. * command options:                      Invoking GPC.
  8660. * compiler version, specifying:         Target Options.
  8661. * COMPILER_PATH:                        Environment Variables.
  8662. * configuration dependent notes:        UNIX.
  8663. * contributors:                         Contributors.
  8664. * Convex options:                       Convex Options.
  8665. * CPLUS_INCLUDE_PATH:                   Environment Variables.
  8666. * cross compiling:                      Target Options.
  8667. * cross-compiler:                       Cross-Compiler.
  8668. * C_INCLUDE_PATH:                       Environment Variables.
  8669. * debugging information options:        Debugging Options.
  8670. * debugging, 88k OCS:                   M88K Options.
  8671. * dependencies for make as output:      Environment Variables.
  8672. * dependencies, make:                   Preprocessor Options.
  8673. * DEPENDENCIES_OUTPUT:                  Environment Variables.
  8674. * dialect options:                      Pascal Dialect Options.
  8675. * directory options:                    Directory Options.
  8676. * divide instruction, 88k:              M88K Options.
  8677. * djgpp:                                DJGPP.
  8678. * DW bit (29k):                         AMD29K Options.
  8679. * EMX:                                  EMX.
  8680. * environment variables:                Environment Variables.
  8681. * file name suffix:                     Overall Options.
  8682. * file names:                           Link Options.
  8683. * global offset table:                  Code Gen Options.
  8684. * GNU Pascal command options:           Invoking GPC.
  8685. * gp-relative references (MIPS):        MIPS Options.
  8686. * GPC_EXEC_PREFIX:                      Environment Variables.
  8687. * grouping options:                     Invoking GPC.
  8688. * hardware models and configurations, specifying: Submodel Options.
  8689. * HPPA Options:                         HPPA Options.
  8690. * i386 Options:                         i386 Options.
  8691. * IBM RS/6000 and PowerPC Options:      RS/6000 and PowerPC Options.
  8692. * IBM RT options:                       RT Options.
  8693. * identifying source, compiler (88k):   M88K Options.
  8694. * installing GNU Pascal:                Installation.
  8695. * Intel 386 Options:                    i386 Options.
  8696. * kernel and user registers (29k):      AMD29K Options.
  8697. * language dialect options:             Pascal Dialect Options.
  8698. * large bit shifts (88k):               M88K Options.
  8699. * Libraries:                            Link Options.
  8700. * LIBRARY_PATH:                         Environment Variables.
  8701. * link options:                         Link Options.
  8702. * Linux:                                System V.
  8703. * M680x0 options:                       M680x0 Options.
  8704. * M88k options:                         M88K Options.
  8705. * machine dependent options:            Submodel Options.
  8706. * make:                                 Preprocessor Options.
  8707. * memory model (29k):                   AMD29K Options.
  8708. * messages, warning:                    Warning Options.
  8709. * MIPS options:                         MIPS Options.
  8710. * MS-DOS <1>:                           EMX.
  8711. * MS-DOS:                               DJGPP.
  8712. * OBJC_INCLUDE_PATH:                    Environment Variables.
  8713. * OCS (88k):                            M88K Options.
  8714. * optimize options:                     Optimize Options.
  8715. * options to control warnings:          Warning Options.
  8716. * options, code generation:             Code Gen Options.
  8717. * options, debugging:                   Debugging Options.
  8718. * options, dialect:                     Pascal Dialect Options.
  8719. * options, directory search:            Directory Options.
  8720. * options, GNU Pascal command:          Invoking GPC.
  8721. * options, grouping:                    Invoking GPC.
  8722. * options, linking:                     Link Options.
  8723. * options, optimization:                Optimize Options.
  8724. * options, order:                       Invoking GPC.
  8725. * options, preprocessor:                Preprocessor Options.
  8726. * order of options:                     Invoking GPC.
  8727. * OS/2:                                 EMX.
  8728. * output file option:                   Overall Options.
  8729. * overloaded virtual fn, warning:       Warning Options.
  8730. * parser generator, Bison:              UNIX.
  8731. * PIC:                                  Code Gen Options.
  8732. * preprocessor options:                 Preprocessor Options.
  8733. * processor selection (29k):            AMD29K Options.
  8734. * r0-relative references (88k):         M88K Options.
  8735. * register positions in frame (88k):    M88K Options.
  8736. * RS/6000 and PowerPC Options:          RS/6000 and PowerPC Options.
  8737. * RT options:                           RT Options.
  8738. * run-time options:                     Code Gen Options.
  8739. * search path:                          Directory Options.
  8740. * second include path:                  Preprocessor Options.
  8741. * sequential consistency on 88k:        M88K Options.
  8742. * smaller data references (88k):        M88K Options.
  8743. * smaller data references (MIPS):       MIPS Options.
  8744. * SPARC options:                        SPARC Options.
  8745. * specifying compiler version and target machine: Target Options.
  8746. * specifying hardware config:           Submodel Options.
  8747. * specifying machine version:           Target Options.
  8748. * stack checks (29k):                   AMD29K Options.
  8749. * storem bug (29k):                     AMD29K Options.
  8750. * structure passing (88k):              M88K Options.
  8751. * submodel options:                     Submodel Options.
  8752. * suppressing warnings:                 Warning Options.
  8753. * SVr4:                                 M88K Options.
  8754. * syntax checking:                      Warning Options.
  8755. * synthesized methods, warning:         Warning Options.
  8756. * System V:                             System V.
  8757. * target machine, specifying:           Target Options.
  8758. * target options:                       Target Options.
  8759. * TMPDIR:                               Environment Variables.
  8760. * underscores, avoiding (88k):          M88K Options.
  8761. * unresolved references and -nodefaultlibs: Link Options.
  8762. * unresolved references and -nostdlib:  Link Options.
  8763. * VAX options:                          VAX Options.
  8764. * warning for overloaded virtual fn:    Warning Options.
  8765. * warning for synthesized methods:      Warning Options.
  8766. * warning messages:                     Warning Options.
  8767. * Win32:                                Win32.
  8768. * Windows 95:                           Win32.
  8769. * Windows NT:                           Win32.
  8770. * zero division on 88k:                 M88K Options.
  8771.  
  8772.  
  8773. 
  8774. Tag Table:
  8775. Node: Top1261
  8776. Node: Copying2768
  8777. Node: Contributors21964
  8778. Node: Funding26480
  8779. Node: Look and Feel28991
  8780. Node: Manifesto36369
  8781. Node: Purpose62413
  8782. Node: Installation63698
  8783. Node: UNIX65429
  8784. Node: System V72956
  8785. Node: Alpha OSF/173771
  8786. Node: DJGPP74650
  8787. Node: EMX75274
  8788. Node: Win3277785
  8789. Node: Cross-Compiler78852
  8790. Node: Steps of Cross80601
  8791. Node: Configure Cross81736
  8792. Node: Build Cross82824
  8793. Node: Invoking GPC83421
  8794. Node: Option Summary86314
  8795. Node: Overall Options96707
  8796. Node: Pascal Dialect Options101622
  8797. Node: Code Gen Options103520
  8798. Node: Warning Options111575
  8799. Node: Debugging Options125855
  8800. Node: Optimize Options135478
  8801. Node: Preprocessor Options145843
  8802. Node: Assembler Options152399
  8803. Node: Link Options152780
  8804. Node: Directory Options157865
  8805. Node: Target Options161371
  8806. Node: Submodel Options165083
  8807. Node: M680x0 Options166292
  8808. Node: VAX Options169815
  8809. Node: SPARC Options170364
  8810. Node: Convex Options176810
  8811. Node: AMD29K Options179005
  8812. Node: ARM Options182054
  8813. Node: M88K Options183485
  8814. Node: RS/6000 and PowerPC Options191487
  8815. Node: RT Options202512
  8816. Node: MIPS Options204230
  8817. Node: i386 Options211693
  8818. Node: HPPA Options217102
  8819. Node: Intel 960 Options220216
  8820. Node: DEC Alpha Options222840
  8821. Node: Clipper Options224526
  8822. Node: H8/300 Options224939
  8823. Node: System V Options225398
  8824. Node: Environment Variables226098
  8825. Node: Keywords230332
  8826. Node: Built-in235582
  8827. Node: Extensions238951
  8828. Node: Extended Pascal288189
  8829. Node: Borland Pascal300800
  8830. Node: Borland compatibility301656
  8831. Node: There is no IDE!302395
  8832. Node: Comments and compiler directives306033
  8833. Node: Units; GPI files and AutoMake309173
  8834. Node: Optimization312409
  8835. Node: Debugging313298
  8836. Node: GPC inline assembler314363
  8837. Node: Objects315876
  8838. Node: Strings316384
  8839. Node: Typed constants317637
  8840. Node: Bit; byte and memory manipulation318569
  8841. Node: User-defined operators319843
  8842. Node: Data types321018
  8843. Node: Files322868
  8844. Node: Built-in constants323549
  8845. Node: Built-in operators323898
  8846. Node: Built-in Procedures and Functions324615
  8847. Node: Parameters325977
  8848. Node: Miscellaneous327051
  8849. Node: GPC Bugs328789
  8850. Node: How to Contribute333135
  8851. Node: FPK Pascal336760
  8852. Node: Index338372
  8853. 
  8854. End Tag Table
  8855.