Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cc.v.6.9.mpx__notes() — Apollo

Media Vault

Software Library

Restoration Projects

Artifacts Sought









                     Domain/C Version 6.9 Software Release Document

                       Versions 6.9.p, 6.9.pmx, 6.9.m, and 6.9.mpx

                                     March 30, 1992

                            Manufacturing Part No. 019457-A00

                    This document describes the Domain/C Version
                    6.9 compilers.  Versions 6.9.m and 6.9.mpx
                    run on MC680x0-based workstations; Versions
                    6.9.p and 6.9.pmx run on Series 10000
                    workstations.  This document lists all
                    changes made to the Domain/C compiler since
                    Version 6.8, all bugs fixed during this
                    time, and all known bugs that are still
                    current.  It supplements the "Domain/C
                    Language Reference" (002093-A01).



































     Domain/C                             1                          Version 6.9









     Copyright Hewlett-Packard Co.  1991.

     First Printing: March, 1992

     UNIX is a registered trademark of UNIX System Laboratories, Inc.


                                       NOTICE

     The information contained in this document is subject to change without
     notice.

     HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS MATERIAL
     INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
     FITNESS FOR A PARTICULAR PURPOSE.  Hewlett-Packard shall not be liable for
     errors contained herein or for incidental or consequential damages in
     connection with the furnishing, performance or use of this material.

     Hewlett-Packard assumes no responsibility for the use or reliability of
     its software on equipment that is not furnished by Hewlett-Packard.

     This document contains proprietary information which is protected by
     copyright.  All rights reserved.  No part of this document may be
     photocopied, reproduced, or translated to another language without the
     prior written consent of Hewlett-Packard Company.

                              RESTRICTED RIGHTS LEGEND
     Use, duplication or disclosure by the U.S. Government is subject to
     restrictions as set forth in subdivision (c) (1) (ii) of the Rights in
     Technical Data and Computer Software Clause at DFARS 252.227.7013.
                             Hewlett-Packard Co.
                             3000 Hanover Street
                             Palo Alto, CA 94304 U.S.A.
     Rights for non-DOD U.S. Government Departments and Agencies are as set
     forth in FAR 52.227-19(c)(1,2).





















     Domain/C                             2                          Version 6.9









     Reader_Notice

     This document resides online in the /install/doc/apollo directory.  You may
     print the online copy of this document by using one of the following
     commands:

     If your installation uses the System V lp print daemon, use an lp command
     similar to the following:

          lp -dprinter_name pathname

     where pathname is the pathname of the release notes, usually

         For MC680x0-based workstations:
         /install/doc/apollo/cc.v.6.9.m__notes
         /install/doc/apollo/cc.v.6.9.mpx__notes

         For Series 10000 workstations:
         /install/doc/apollo/cc.v.6.9.p__notes
         /install/doc/apollo/cc.v.6.9.pmx__notes

     If your installation uses the Domain print system, use the following Aegis
     /com/prf command:

          prf pathname -pr printer_name -npag

     If your installation uses the BSD lpd print daemon, use an lpr command
     similar to the following:

          lpr -Pprinter_name pathname


























     Domain/C                             3                          Version 6.9









                                        Contents




     CHAPTER 1 OVERVIEW OF DOMAIN/C VERSION 6.9

              1.1  Debug Information Compression in Object Files .........  5
              1.1.1   New .s Sections in Object Files ....................  6
              1.1.2   Include References and the Include Table Record ....  6
              1.2  New Version of SysV lint ..............................  7
              1.3  The -nfpra Option: Suppressing Expression
                   Reordering ............................................  8
              1.4  C++ Compatibility .....................................  8

     CHAPTER 2 INSTALLATION INFORMATION

              2.1  Online Manual Pages for /bin/cc ....................... 12
              2.2  The mrgri Tool ........................................ 12
              2.3  Running Programs on SR10.1 Nodes ...................... 13

     CHAPTER 3 DOCUMENTATION

              3.1  Absolute Pathnames in #include Directives ............. 14
              3.2  Search Paths for Include Files ........................ 15
              3.3  The # and ## Operators ................................ 15
              3.4  Bitwise Complement Operators .......................... 16
              3.5  The #pragma HPMODULE Directive ....................... 16
              3.6  The STDC Predefined Macro ......................... 16
              3.7  Relational Expressions ................................ 16
              3.8  Listing File Pathname ................................. 16
              3.9  Prototype of fputs() Function ......................... 17
              3.10 ISO Latin-1 Character Set ............................. 17
              3.11 The lint Utility ...................................... 17
              3.12 The std$call Convention .............................. 17

     CHAPTER 4 BUGS AND BUG FIXES

              4.1  Known Bugs and Limitations ............................ 18
              4.2  Fixed Bugs ............................................ 20
              4.3  Fixed APRs ............................................ 21
                   4.3.1  C Language APRs ................................ 21
                   4.3.2  C Documentation APRs ........................... 24













     Domain/C                             4                          Version 6.9
















                                      CHAPTER 1

                          OVERVIEW OF DOMAIN/C VERSION 6.9





     Version 6.9 of the Domain/C compiler offers three new features, which we
     describe in this chapter:

          o  Debug information compression in object files

          o  A new version of lint for the SysV environment

          o  A compiler option to suppress reordering of floating-point
             operands at the highest level of optimization

     This chapter also describes how to ensure compatibility between Domain/C
     Version 6.9 and Domain/C++ Version 2.0.0 (an older version of
     Domain/C++).

     For more information about the Domain/C compiler, consult the "Domain/C
     Language Reference" (Order No. 002093-A01).

     NOTE:     This document applies to all versions of the Domain/C compiler
               (those that generate code for MC680x0-based workstations, and
               those that generate code for Series 10000 workstations).
               Wherever there are differences among the versions, we state so
               explicitly.



     1.1  Debug Information Compression in Object Files


     On systems running Software Release 10.4, the Domain/C compiler can
     produce output object files with compressed debug information.  Debug
     compression works by eliminating replicated debug information, thus
     reducing the size of the object file.  Debug compression is especially
     effective in programs with a large number of data types declared in
     include files that are shared by many compilation units within the same
     program.  Requesting debug compression for such programs can mean up to
     50% savings in the size of the object file.  Debug compression may have
     little or no effect on other programs.




     Domain/C                             5                          Version 6.9









     To request debug compression, use the compiler option -cd (/com/cc) or
     -W0,-cd (/bin/cc).  The default, -ncd (-W0,-ncd), requests no debug
     compression.

     NOTE:     Do not confuse debug information compression with data
               compression in the object file.  Data compression is an existing
               feature of Domain object files and is controlled by the
               -compress and -ncompress compiler options.  For more information
               on data compression, refer to the "Domain/C Language Reference."


     Debug compression is only available at Software Release 10.4 and later
     releases of the Domain/OS operating system.  You must also use Version 2.0
     or later of the HP Distributed Debugging Environment with object files
     that have compressed debug information.  Earlier versions of DDE (such as
     Domain/DDE Version 1.0) will not recognize the new object file format.


     1.1.1 New .s Sections in Object Files

     As part of a new approach to handling debug information, the Domain/C
     compiler now places include file information in a new .s section in the
     COFF object file.  This .s section is part of the debug information in the
     object file.

     The compression of debug information occurs when several modules include
     the same file and thus have identical .s sections.  The binder and the
     link editor overlay these .s sections when combining modules to create the
     final object file.  This overlaying can reduce the overall size of the
     object file significantly, especially for strongly typed languages such as
     C++ and Pascal.

     An object file can contain no, one, or several .s sections, depending on
     the number of include files associated with the object file.  A .s section
     does not necessarily have a one-to-one correspondence to an include file.
     If two include files have circular dependencies on each other, they may be
     merged into one .s section.

     The name of a .s section is a ".s." followed by a hexadecimal number, for
     example:

          .s.ABCDABCDABCDABCD



     1.1.2 Include References and the Include Table Record

     The include table record in a section lists all of the .s sections
     required by that section.  The include table record appears only in
     .symbols or .s sections.  A .s section may need an include table record if
     it has dependencies on other .s sections.





     Domain/C                             6                          Version 6.9









     An include reference in a .symbols or .s section is actually a
     user-defined type descriptor that refers to the include table record for
     that .symbols or .s section.  This type descriptor provides an index into
     the list of .s sections in the include table record.  The formats for the
     include table record and include reference type descriptor are in the
     /usr/include/apollo/dst.h header file.


     1.2  New Version of SysV lint


     At Software Release 10.4 of Domain/OS, the SysV environment provides a new
     version of the lint utility.  Domain/OS lint had not been modified since
     before SR10.0 and had become obsolete.  The new version supports ANSI C
     programs, all Domain/C extensions, and SR10.3 header files.

     The behavior of BSD lint remains unchanged; therefore, we recommend that
     BSD users employ the SysV lint.

     The SR10.4 version of SysV lint supports two new options, -s and -A, and
     two new preprocessor symbols.  The new options are as follows:

     -s           Makes stricter checks about pointer and structure alignments
                  that can prevent portability.  Complains about a cast that
                  converts a pointer from a less restrictive alignment to a
                  more restrictive alignment.  Complains about a structure
                  member that is not naturally aligned.

     -A mode      Specifies the compilation standard to be used by lint.  The
                  mode can be one of the following letters:

                  xansi        Extended ANSI mode.  Uses the ANSI C
                               preprocessor; issues warnings for function calls
                               not in the scope of a function prototype; allows
                               Domain extensions; does not define the
                               preprocessor symbol lint.  This mode is the
                               default.

                  ansi         Strict ANSI mode.  Uses the ANSI C preprocessor;
                               issues warnings for function calls not in the
                               scope of a function prototype; does not allow
                               Domain extensions; does not define the
                               preprocessor symbol lint.

                  nansi        Non-ANSI mode.  Uses the K&R C preprocessor;
                               does not issue warnings for function calls not
                               in the scope of a function prototype; allows
                               Domain extensions; defines the preprocessor
                               symbol lint.

     Two new preprocessor symbols, lint and LINT, are defined to allow
     certain questionable code to be altered or removed for lint.  In addition,
     the pre-processor symbol lint is defined if -A nansi is specified.



     Domain/C                             7                          Version 6.9









     For complete information on SysV lint, type man lint in a SysV
     environment.


     1.3  The -nfpra Option: Suppressing Expression Reordering


     If your program does floating-point arithmetic, and if compiling your
     program at optimization level 4 produces results different from those
     obtained at lower optimization levels, you may want to use the compiler
     option -nfpra to suppress the reordering of operands in floating-point
     expressions.  The -nfpra option lets you get the benefit of other level 4
     optimizations (notably inlining) without sacrificing accuracy in
     floating-point operations.

     When computers evaluate floating-point expressions, the algebraic law of
     associativity does not apply.  For example,

          a + (b + c)

     does not equal

          (a + b) + c

     The associative law does not work for floating-point operations because,
     on computers, floating-point operations are inherently inexact.  Each
     operation usually introduces a small rounding error into the result, so
     changing the operations usually changes the result.  For this reason,
     Domain compilers ordinarily do not reorder floating-point expressions.  At
     the highest level of optimization, however, reordering of floating-point
     operands may occur in some situations.

     Most of the time, the results of reordered floating-point operations are
     so close to the results of unreordered operations that no difference is
     noticeable.  However, occasionally a result will be remarkably different;
     for example, if a result obtained without reordering is very close to the
     maximum normalized value, reordering could cause the result to overflow.
     In such cases, use the -nfpra option.

     For more information about floating-point operations, see the "Domain
     Floating-Point Guide" (Order No. 15853-A00).


     1.4  C++ Compatibility


     Domain/C Version 6.9 is compatible with Domain/C++ Version 2.0.0 and more
     recent versions of Domain/C++.

     To ensure compatibility between Domain/C Version 6.9 and Domain/C++
     Version 2.0.0, compile your C++ source files with the -W0,-ncompress
     option.  If you do not use -W0,-ncompress, constructors and destructors
     for static objects will not execute correctly.  In addition, do not



     Domain/C                             8                          Version 6.9









     declare any virtual function inline.  If you declare a virtual function
     inline, a bug in the C++ translator causes it to generate incorrect C
     code, and the C compiler issues an error message.  Since the C++
     translator ordinarily does not perform inline expansion of virtual
     functions in any case, this restriction usually has no effect on the
     quality of your code.

     Domain/C Version 6.9 is fully compatible with Domain/C++ Version 2.1.0:
     if you use Domain/C++ Version 2.1.0, you do not need to specify
     -W0,-ncompress, and the restriction on virtual functions does not apply.














































     Domain/C                             9                          Version 6.9
















                                      CHAPTER 2

                              INSTALLATION INFORMATION





     You can install Domain/C Version 6.9 on a user node (one equipped with
     monitor and keyboard) or a Domain Server Processor (DSP) that is running
     Software Release 10.0 or a more recent version of the Domain/OS operating
     system.  (In order to run Domain/C Version 6.9 on a node running SR10.1,
     you must install a patch version of /lib/pmlib.  For more information, see
     Section 2.3.)

     NOTES:    In order to take advantage of debug compression (described in
               Chapter 1), you must be on a node that is running SR10.4 or a
               more recent version of the Domain/OS operating system, and that
               has installed Version 2.0 of the HP Distributed Debugging
               Environment.

               In order to get full ANSI C support, you must be on a node that
               is running SR10.3 or a more recent version of the Domain/OS
               operating system, and that has installed full ANSI C support
               with the operating system.  ANSI C support provides ANSI C
               header files, the ANSI C preprocessor, and a new version of
               /bin/cc.

     Two compiler packages are available:

          o  The 680x0-based workstation package contains Version 6.9.m and
             Version 6.9.mpx.

          o  The Series 10000 workstation package contains Version 6.9.p and
             Version 6.9.pmx.

     Table 2-1 shows the four variants of Domain/C Version 6.9.












     Domain/C                            10                          Version 6.9









                       Table 2-1.  Domain/C Compiler Variants

                     Variant     Runs on          Generates Code For
                     -------     -------          ------------------
                     Version     680x0-based      680x0-based
                     6.9.m       workstations     workstations

                     Version     680x0-based      Series 10000
                     6.9.mpx     workstations     workstations

                     Version     Series 10000     Series 10000
                     6.9.p       workstations     workstations

                     Version     Series 10000     680x0-based
                     6.9.pmx     workstations     workstations

     You can install the whole package or a single compiler version.  Table 2-2
     lists the amount of disk space required for the various versions.

                        Table 2-2.  Disk Storage Requirements

                      Version(s)                Blocks Required
                      ----------                ---------------
                      .m                        2200

                      .mpx                      4400

                      both .m and .mpx          5700

                      .p                        5800

                      .pmx                      2800

                      both .p and .pmx          7700


     If  you  have  the  media for a 680x0-based workstation, the Domain/C
     media contain the following products:

         Product       Version       Selection File          Override File
         -------       -------       --------------          -------------
         cc            6.9.m         aa.cc                   ov.cc
         cc            6.9.mpx       aa.cc                   ov.cc


     If you have the media for a Series 10000 workstation (PRISM), the Domain/C
     media contain the following products:

         Product       Version       Selection File          Override File
         -------       -------       --------------          -------------
         cc            6.9.p         aa.cc                   ov.cc
         cc            6.9.pmx       aa.cc                   ov.cc




     Domain/C                            11                          Version 6.9









     Selection and override files reside in the directory

          //<authorized_area>/install/templates/apollo/<product_name>.v.<version>

     where <authorized_area> is your authorized area, <product_name> is the
     product name (as listed in the first column of the table above), and
     <version> is the version number (as listed in the second column of the
     table above).

     For directions about how to install this product and about the use of
     selection and override files, see the manual "Installing Domain Software"
     (Order No. 008860-A03).

     NOTE:     When you install a new version of a Domain compiler, do not use
               the update subcommand with either the config or the install
               tool.  This subcommand does not work correctly when you install
               compilers.



     2.1  Online Manual Pages for /bin/cc


     As of Version 6.8, the installation process for the Domain/C compiler
     installs the SysV and BSD manual pages for the /bin/cc command.

     The man pages are also installed as part of the Domain/OS operating
     system, but the Domain/OS man pages for /bin/cc may not be the latest
     ones.  If you install Domain/OS and you want to have the latest versions
     of the /bin/cc man pages, install the C compiler after you install
     Domain/OS.


     2.2  The mrgri Tool


     Compilers that run on different machine types but produce code for the
     same machine type can have their release indexes merged using the mrgri
     tool.  For instance, the Version 6.9.p and the Version 6.9.mpx compilers
     can be merged, yielding a cmpexe compiler that runs on any Apollo
     workstation and produces code for the Series 10000 workstation.

     SR10.3 and later versions of Domain/OS include a new version of the mrgri
     installation tool.  The SR10.2 version of mrgri enabled you to merge only
     patches with products, or to merge two products that were the same except
     for different ISP types.  The new version is less restrictive; it permits
     you to merge any two products, assuming the products are deemed mergeable
     in the products' release notes.  A significant advantage of the new mrgri
     is the ability to merge Product Support Kits (PSKs) with Domain/OS.

     The new version of mrgri has two new command line switches: -merge and
     -cmpexe.  Otherwise, the command-line syntax is the same as the SR10.2
     version.  The -merge and -cmpexe switches are described below.  For



     Domain/C                            12                          Version 6.9









     descriptions of the other command-line options and a more comprehensive
     description of mrgri, see "Installing Domain Software" and the mrgri help
     file in //<authorizedarea>/install/help/mrgri.hlp.

     The new mrgri syntax is

          mrgri { -merge | -cmpexe } [-i] -s source_AA [-t target_AA]
                [-v new_version] [-p new_name] primary_product secondary_product

     You must use either the -merge or the -cmpexe switch:

     -merge       Used to merge two different products; for example, a patch
                  with a layered product or with Domain/OS, or a PSK with
                  Domain/OS. The two products to be merged must either have the
                  same ISP type (m68k, a88k, or cmpexe) or the primary_product
                  must be a cmpexe product.

     -cmpexe      Used to create compound (cmpexe) products; that is, to
                  combine two products with the same name but with different
                  ISP types. The two products to be combined must have
                  different ISP types.

     NOTE:     mrgri checks only that the ISP types of the primary_product and
               secondary_product conform to the rules described for the -merge
               and -cmpexe switches; it does not check the products or product
               names in any way to ensure that they can be merged
               successfully.  Before attempting to merge products, check the
               products' release notes to determine whether the products can be
               merged, which versions can be merged, and what restrictions you
               must follow, if any, when installing and using the merged
               product.



     2.3  Running Programs on SR10.1 Nodes


     Domain/C Version 6.9 will not run on a 680x0-based workstation running
     SR10.1.  Also, if you compile and link a program on a workstation running
     SR10.3 or a later version of Domain/OS, the program will not run on a
     680x0-based workstation running SR10.1.

     In both cases, you will receive the following error message:

          absolute load address already occupied (process manager/loader)

     The problem is with the SR10.1 version of /lib/pmlib.  Patch_m0159
     contains a new /lib/pmlib that you can install on a workstation running
     SR10.1.  The new pmlib allows the workstation to run Domain/C Version 6.9
     as well as programs linked on workstations running SR10.3 or later.






     Domain/C                            13                          Version 6.9
















                                      CHAPTER 3

                                    DOCUMENTATION





     The "Domain/C Language Reference" was revised for Version 6.8.  This
     edition (Order No. 002093-A01) describes all features of Domain/C through
     Version 6.8.  This chapter describes several corrections to this manual.

     You can call the Tech Pubs Connection with questions or comments about any
     of our documentation, or to find out about new manuals.

          o  In the USA, call 1-800-441-2909

          o  Outside the USA, call (508) 256-6600 ext. 4965

     To order manuals, call HP Apollo DIRECT at 1-800-637-7740. Outside the
     USA, call (508) 256-6600 and ask for HP Apollo DIRECT.


     3.1  Absolute Pathnames in #include Directives


     The discussion of the #include directive in Chapter 4 (page 4-106) states
     that absolute pathnames that begin with a tilde (~) are accepted by both
     the ANSI preprocessor and the non-ANSI Aegis preprocessor.  In fact, only
     the non-ANSI Aegis preprocessor accepts absolute pathnames that begin with
     a tilde; neither the ANSI preprocessor nor the non-ANSI UNIX preprocessors
     accept such pathnames.  (APR 26C6C757)

















     Domain/C                            14                          Version 6.9









     3.2  Search Paths for Include Files


     Chapter 4 and Sections 6.5.24 and 6.5.25 provide incorrect information
     about search paths for include files.  The C preprocessor does not search
     in the working directory for include files.  Therefore, the third
     paragraph of Section 6.5.24 should read as follows:

          When you enclose the include filename in double quotes, the C
          preprocessor first searches the directory of the source file in which
          the #include directive occurs; then the directories specified by -I
          (if any); and finally, the directory /usr/include.  The rules are the
          same whether you compile with -xansi, -ansi, or -nansi.

     In Section 6.5.25, the list of directories searched for localincludefile
     should read as follows:

          1. /directory_of_including_source_file/localincludefile (all
             preprocessors except non-ANSI Aegis preprocessor) or
             /current_working_directory/localincludefile (non-ANSI Aegis
             preprocessor)

          2. personal/localincludefile

          3. ../impersonal/localincludefile

          4. /usr/include/localincludefile

     Also, at the end of the "#include" entry in Chapter 4, the numbered list
     should read as follows:

          1. The preprocessor searches in the directory of the including source
             file.

          2. If it is not there, the preprocessor searches in any directories
             you specified with -I or -idir.

          3. If it is not in any of them, the preprocessor searches in
             directory /usr/include.

          4. If it is not there, the preprocessor issues an error.

     (APR 26CC2C0B)


     3.3  The # and ## Operators


     In Section 4.4, the following should be added to the Note after Table 4-3:
     "The # and ## operators are available only with the ANSI preprocessor."






     Domain/C                            15                          Version 6.9









     3.4  Bitwise Complement Operators


     In Figure 4-8 in the "Bit Operators" entry of Chapter 4, the bottom right
     table should appear as follows:

                                ~  Bitwise
                                   Complement

                              Bit x   |  Bit x of
                              of op1  |  result
                              -------------------
                                 1    |     0
                                 0    |     1



     3.5  The #pragma HPMODULE Directive


     In the "#pragma" entry of Chapter 4, the description of the default module
     name used by the dde and dbx utilities is incorrect.  It should say, "If
     you do not use an HPMODULE pragma, the compiler uses the source filename
     without the .c filename suffix.  For example, the default module name for
     test.1.c is test.1."  (APR 7D986B81)


     3.6  The STDC Predefined Macro


     In the "Predefined Macros" entry of Chapter 4, the description of STDC
     should read, "Expands to 1 if the compiler conforms to the ANSI C
     standard."


     3.7  Relational Expressions


     In the "Relational Operators" entry of Chapter 4, the third line of Table
     4-14 is incorrect.  The expression should be "5 == 5".


     3.8  Listing File Pathname


     The last sentence of Section 6.5.29 is incorrect.  The listing file has
     the same base name as the object file, not the source file.  The sentence
     should read, "If you omit pathname, the listing file is given the same
     base name as the object file, except that .lst replaces .c as the
     suffix."  This means that if you specify both -l and -b, as in

          /bin/cc -W0,-b,my_object.o -W0,-l my_source.c




     Domain/C                            16                          Version 6.9









     the listing file is named myobject.lst.  This naming convention also
     applies to the listing options -exp (Section 6.5.20) and -map (Section
     6.5.34).  (APR 7D980A37)


     3.9  Prototype of fputs() Function


     In Section 8.2.10.2, the prototype shown for the fputs() function is
     incorrect.  It should say:

          int fputs(const char *s, FILE *stream);

     See Section C.12.6 for the correct prototype. (APR 26C62B4D)


     3.10  ISO Latin-1 Character Set


     The note at the beginning of Appendix A should add that the characters
     with decimal numbers 152 through 154 are also missing from the table
     because they are reserved for future standardization.  In Table A-1, the
     character with decimal number 96 is a grave accent, not an apostrophe.


     3.11  The lint Utility


     In the Note at the beginning of Appendix H ("BSD lint:  A C Program
     Checker"), "SR10.0" should be changed to "SR10.3".  The note should read
     as follows:

     NOTE:     The lint utility is supported only for Domain/C programs that
               compile with the -A nansi (/bin/cc) or -nansi (/com/cc) option,
               that do not use function prototypes or the #attribute[aligned]
               (or attribute((aligned))) modifier, and that do not use
               header files (such as <stdio.h>) issued with SR10.3 or later
               versions of Domain/OS.

     The Note at the beginning of Appendix I ("SysV lint Utility") should be
     removed.  SysV lint now supports ANSI C, Domain/C extensions, and SR10.3
     header files.


     3.12  The std$call Convention


     Appendix J states that you can use the std$call convention only with the
     compiler option -A nansi (/bin/cc) or -nansi (/com/cc).  This statement is
     incorrect; you can also use std$call with the options -A xansi and -xansi
     (the default) and with -A ansi and -ansi.





     Domain/C                            17                          Version 6.9
















                                      CHAPTER 4

                                 BUGS AND BUG FIXES





     This chapter lists known bugs and limitations in Domain/C Version 6.9 as
     well as bugs and Apollo Problem Reports (APRs) that have been fixed since
     Domain/C Version 6.8.

     See Chapter 3 of this document for information about known errors in the
     "Domain/C Language Reference."


     4.1  Known Bugs and Limitations


     This section describes known bugs and limitations in Domain/C Version
     6.9.

          o  In order to run Domain/C Version 6.9 on a 680x0-based workstation
             running SR10.1, you must install a patch for /lib/pmlib.  For more
             information, see Section 2.3.

          o  The -nalnchk option has been disabled since Domain/C Version 6.8
             because of a bug in its operation.  This option enabled you to
             turn off the messages that told you when your data was not
             naturally aligned.  The -alnchk option is the default for the
             Series 10000 compilers (Versions 6.9.p and Version 6.9.mpx).

             The compilers that generate MC680x0 code by default do not display
             alignment messages.  You can, however, enable these messages by
             specifying the -alnchk option.

             The -nalnchk option may be implemented again at a later compiler
             release.

          o  If you use ANSI C header files in conjunction with the -A nansi or
             -nansi option, you will receive some warnings about redefined
             functions, even if you define the macro CLASSICTYPES as
             instructed in Chapter 1.  Please ignore these warnings.

          o  If you use Domain/C to build the application TeX, the Series 10000
             compilers (Version 6.9.p and Version 6.9.mpx) generate incorrect



     Domain/C                            18                          Version 6.9









             code for the source file /tex/web2c/ctex/tex6.c if you compile
             this file at an optimization level greater than 0.  Therefore,
             either compile this file at optimization level 0 or compile the
             entire application at optimization level 0.  With /bin/cc, level 0
             is the default; with /com/cc, you must specify -opt 0.

          o  The following is a generalized description of a code sequence that
             causes the compiler variants that generate code for MC680x0-based
             workstations to optimize poorly and possibly generate faulty code:

                     10      One or more basic blocks that ends with an
                             unconditional GOTO 30

                             Zero or more basic blocks

                     20      One or more basic blocks, at least one of which
                             branches to 50

                             Zero or more basic blocks

                     30      An abnormally-entered basic block

                             Zero or more basic blocks which eventually arrive
                             at 40

                     40      A basic block that ends with an unconditional
                             GOTO 20

                             Zero or more basic blocks

                     50      Execution continues ...

             where:

                     a basic block is a block of straight-line code whose
                     boundaries are defined by branches and labels (but not
                     function calls).

                     an abnormally-entered basic block is a block that may be
                     entered by means of a FORTRAN END= or ERR= clause, a
                     FORTRAN assigned GOTO, a C setjmp() or longjmp(), a Pascal
                     non-local GOTO, or a cleanup handler in any language.

             Although programmers do not usually write this kind of spaghetti
             code, translators such as Ratfor and C++ can generate it.











     Domain/C                            19                          Version 6.9









          o  There is a problem with precedence of operators.  The precedence
             of ++ and casting are the same and they work from right to left.
             However, the following program does not compile the casting after
             '++'; the compiler takes it as being an expression.

                  main ()
                  {
                      unsigned char *pt;
                      short         this;

                      this = *++(short *)pt;
                  }

             This generates the following errors:

                  [Error #116]  Improper expression; "short" found.
                  [Error #116]  Improper expression; ")" found.


          o  When you use the HP Distributed Debugging Environment (HP/DDE) to
             step through a program, the debug information created by the C
             compiler sometimes causes the line pointer to jump over program
             lines where it would normally be expected to stop.

          o  If you use the HP Distributed Debugging Environment (HP/DDE) to
             step through code in an included file that contains executable
             code, the debugger may not show the correct routine name and line
             number information.

          o  The -esf option suppresses the display of error, warning, and
             informational messages.  Using -esf generates a message that there
             are messages, but it does not display those messages.



     4.2  Fixed Bugs


     This section lists known bugs described in the release notes for Domain/C
     Version 6.8 that have been fixed since Version 6.8.

          o  If you used a dereferenced postincremented pointer as the
             expression in a switch statement, a run-time error occurred.  For
             example, a switch statement like the following caused an error:

                  int *ip;
                      .
                      .
                  switch (*ip++) {
                      .
                      .
                  }




     Domain/C                            20                          Version 6.9









          o  If you compiled with -ansi or -xansi, /com/cc did not display the
             names of include files in diagnostic messages.

          o  If you specified the -A ansi option to /bin/cc, /bin/cc did not
             pass the option on to /bin/ld as stated in Section 6.5.6 of the
             "Domain/C Language Reference."

          o  If you used a function prototype to declare a function that had an
             old-style definition, the compiler generated bad code if the
             argument in the definition was char or short and the function
             prototype declared the argument as int, or if the argument in the
             definition was float and the function prototype declared the
             argument as double.  For example, if the declaration was

                  int func(int);

             and the definition signature was

                  func(x)
                  char x;

             Domain/C passed the argument incorrectly.



     4.3  Fixed APRs


     This section lists the C language and documentation Apollo Problem Reports
     (APRs) fixed since Domain/C Version 6.8.


     4.3.1 C Language APRs

     The following C language APRs have been fixed:

          06AE47FC    DDE on Series 10000 had print problems on certain
                      variables; the 6.8 C compiler was generating bad debug
                      information for certain structure fields.
          06AE635F    Use of ANSI string built-in functions generated invalid
                      warnings.
          26C6F280    It was impossible to undefine STDC in ANSI mode.
          45CDF8E4    The -es and -esf options, when used together, precluded
                      binary and/or listing options.
          7CF20FC6    cpp in 10.3 BSD4.3 environment didn't accept the -Y
                      option.
          7CF2C630    The C compiler failed with a reference to illegal address
                      error with -nansi and BUILTINS if strncmp() was given
                      the wrong number of arguments.
          7D980280    A C routine called from FORTRAN crashed at run time in a
                      conditional expression.
          7D980D74    Dereferencing a post-incremented pointer to a structure
                      member in a switch generated bad code.



     Domain/C                            21                          Version 6.9









          7D981B3F    A typedef of void to VOID caused the C compiler to abort
                      with an internal error when -opt 4 was used.
          7D982935    The compiler generated incorrect debug information for
                      records larger than 64K. This would cause the DDE command
                      "print sizeof(s)" to print an incorrect number when s was
                      a structure larger than 64K.
          7D9832B0    The compiler got incorrect line numbers from #line
                      directives.
          7D983A1F    Dereferencing a post-incremented pointer in a switch gave
                      bad code.
          7D9859A9    Using the optimizer with /bin/cc produced a 'Compiler
                      failure, registers locked' error.
          7D985CC9    The C compiler sometimes placed incorrect line numbers in
                      the listing file when processing header files.
          7D985F95    In a nested expression where the result of a shift was
                      being used as the argument of a multiply, and both of the
                      shift arguments were small constants, the result of the
                      multiplication was sometimes incorrect.  (The compiler
                      was using a too-small integer for the temporary variable
                      that held the result of the shift.)
          7D986B35    The compiler warning "Relocatable address on non-word
                      boundary" occurred when the number of elements in a static
                      char array was an exact multiple of 16.
          7D986E75    Compiler continued to report an error summary line even
                      though the -esf option was specified.
          7D987470    Compiler incorrectly passed floating point arguments to
                      functions invoked indirectly through a pointer to function
                      parameter.
          7D9883C2    Error messages did not include header file names in
                      /com/cc 6.8.
          7D988E04    cc 6.8 generated bad code at -opt 3 for post-incremented
                      pointers.
          7D98A2E7    User program produced incorrect results at any
                      optimization setting except -dba.
          7D98A59D    Program failed when #line directive at the beginning of
                      the program specified a file name different from the
                      actual file name.
          7D98C2D6    Postincrementing pointers to arrays of structures that
                      contained function pointers as members produced a runtime
                      error.
          7D98C84D    The compiler failed when the limit for global variables
                      was exceeded.  The compiler now reports an error stating
                      that the limit has been exceeded.
          7D98D459    Unsigned arithmetic operations on short data types yielded
                      incorrect results with -xansi or -ansi.
          7D98DFB3    Unsigned arithmetic operations on short data types yielded
                      incorrect results with -nansi.
          7D98E293    The value of LONGMIN in the limits.h header file was
                      interpreted by the compiler as a negative number.







     Domain/C                            22                          Version 6.9









     The following C tools APRs have been fixed:

          000DD8EE    /sys5.3/usr/lib/yaccpar misdeclared a pointer.
          000DDCB7    SR10.1 BSD4.3 cc and cpp did not obey -H switch.
          4EA110E4    SR10.1 BSD4.3 cc and cpp did not obey -H switch.
          7CF248D0    The lint tool did not work under SR10.3.
          7D98F5CA    lint did not understand ANSI constructs or Domain
                      extensions.

     The following C APRs relating to the M680x0 code generator have been
     fixed:

          000DE01A    68k compiler failed at -opt 3 with the message:
                      "internal error -- Procedure length exceeds 32k."
          000DE1D8    COFF format objects intolerably large.
          7D981DE9    if statement was ignored under certain circumstances.
          7D982A2A    cc backend failure at -opt 3 or -opt 4: error #144,
                      registers locked.
          7D98665E    Compiler failed (Error #144) when compiling user program
                      with -opt 4.
          7D989A1B    C failed some arithmetic tests.
          7D98CA26    Listings did not accurately reflect the -cpu settings
                      mathlib or mathlibsr10.
          7D98E041    Cases at the end of a large C switch statement got a bus
                      error/odd address error.

     The following C APRs relating to the Series 10000 code generator have been
     fixed:

          04607F31    DDE was unable to print the values of the arguments in a
                      parameter list of a subroutine.
          26CCDD53    At higher levels of optimization, the order of two lines
                      of code was wrongly reversed.
          7D98717C    Program that used online example of fault handler did not
                      work.

     The following C-related optimizer APRs have been fixed:

          000DDD6A    Optimizer did not fold an AND-over-shift into zero.
          000DE3BD    The procedure inliner did not properly inline an array
                      actual parameter into a call site.
          06AEC7CC    Compiler failed (Error #145) when optimization was used.
          08907992    Short constants (constants less than 32768) were not
                      handled correctly.
          26C6E21F    Optimizer generated bad code for complex conditional (?:)
                      using dereferenced double pointers.
          4EA1E9E2    /bin/cc and -O (optimization level 3) caused erroneous
                      results.
          7C32EC6C    Spurious warnings were generated indicating that variables
                      had not been initialized.
          7D98141A    User program produced incorrect results when compiled with
                      -opt 4, but not when compiled -opt 3.




     Domain/C                            23                          Version 6.9









          7D98494E    Incorrect execution of floating-point comparison unless
                      optimizer was turned off.
          7D985EC0    Compiler neither warned nor took corrective action when
                      asked to right-shift a large negative number of bits
                      (undefined behavior).
          7D986E95    Using both -O and -DBUILTINS sometimes caused a
                      registers locked error.
          7D987099    Compiler failed with error message: "vector_transform:
                      bad kind for loop_trip_count."
          7D987728    User program failed when compiled with -opt 3 or higher,
                      giving incorrect results for complex arithmetic
                      calculations.
          7D9882C5    User program behaved differently when compiled with -cpu
                      mathlib than when compiled with -cpu mathlibsr10, at
                      -opt 1.
          7D98A371    Error #923 occurred with default optimization, but not
                      with -opt 2.
          7D98A93F    C compiler caused incorrect results with optimization
                      level 3.
          7D98B625    Compiler failed with "lost value of node" error at -opt 3.
          7D98B7A5    C compiler caused incorrect results on CHAR compiling with
                      -opt 3.
          7D98F971    User program produced different output on a 68040-based
                      node at -opt 3 or above.



     4.3.2 C Documentation APRs

     The following APRs relating to C documentation have been fixed:

          00A95296    UNIX cbreak dysfunction from an xterm with -A systype,any.
          26C62B4D    fputs() function documented wrong in C manual: bad
                      prototype.  (Documented in Chapter 3 of this document.)
          26C6CE8E    Please add man page for cpp in BSD4.3.
          26CC2C0B    Documentation problem in current C manual (search paths
                      for include files).  (Documented in Chapter 3 of this
                      document.)
          7D980A37    /com/cc -l used binary instead of source pathname for
                      .lst file name.  (Documented in Chapter 3 of this
                      document.)
          7D986B81    Domain C documentation problem (description of #module
                      directive).  (Documented in Chapter 3 of this document.)













     Domain/C                            24                          Version 6.9




Typewritten Software • bear@typewritten.org • Edmonds, WA 98026