Domain C Compiler Software Release Document
Software Release 10.1
October 12, 1988
This document describes the SR10.1
Domain C Compiler Version 6.5.mpx. It
lists all known bugs and all bugs fixed
since the previous release of the
compiler. These notes also describe
features that are not documented in the
Domain_C__Language___Reference manual or
the Series_10000_Programmer's_Handbook.
Use, duplication, or disclosure by the Government is subject to restrictions
as set forth in subparagraph (c) (1) (ii) of the Rights in Technical Data
and Computer Software clause at DFARS 52.227-7013.
Apollo Computer Inc.
330 Billerica Road
Chelmsford, MA 01824
(508) 256-6600
Notice: Notwithstanding any other lease or license agreement that may
pertain to, or accompany the delivery of, this computer software, the rights
of the Government regarding its use, reproduction and disclosure are as set
forth in Section 52.227-19 of the FARS Computer Software - Restricted Rights
clause.
Confidential and Proprietary. Copyright 1988 Apollo Computer, Inc.,
Chelmsford, Massachusetts. Unpublished -- all rights reserved under the
Copyright Laws of the United States.
This notice shall be marked on any reproduction of these data, in whole or
in part.
Confidential and Proprietary. Copyright 1988 Apollo Computer, Inc.,
Chelmsford, Massachusetts. Unpublished -- rights reserved under the
Copyright Laws of the United States. All rights reserved.
First Printing: November, 1988
Latest Printing: November, 1988
This document was formatted using the FMT tool distributed with the Domain
computer system.
Apollo and Domain are registered trademarks of Apollo Computer Inc.
UNIX is a registered trademark of AT&T in the USA and other countries.
3DGMR, Aegis, D3M, DGR, Domain/Access, Domain/Ada, Domain/Bridge, Domain/C,
Domain/ComController, Domain/CommonLISP, Domain/CORE, Domain/Debug,
Domain/DFL, Domain/Dialogue, Domain/DQC, Domain/IX, Domain/Laser-26,
Domain/LISP, Domain/PAK, Domain/PCC, Domain/PCI, Domain/SNA, Domain X.25,
DPSS, DPSS/Mail, DSEE, FPX, GMR, GPR, GSR, NLS, Network Computing Kernel,
Network Computing System, Network License Server, Open Dialogue, Open
Network Toolkit, Open System Toolkit, Personal Supercomputer, Personal Super
Workstation, Personal Workstation, Series 3000, Series 4000, Series 10000,
and VCD-8 are trademarks of Apollo Computer Inc.
Apollo Computer Inc. reserves the right to make changes in specifications
and other information contained in this publication without prior notice,
and the reader should in all cases consult Apollo Computer Inc. to determine
whether any such changes have been made.
THE TERMS AND CONDITIONS GOVERNING THE SALE OF APOLLO COMPUTER INC. HARDWARE
PRODUCTS AND THE LICENSING OF APOLLO COMPUTER INC. SOFTWARE PROGRAMS CONSIST
SOLELY OF THOSE SET FORTH IN THE WRITTEN CONTRACTS BETWEEN APOLLO COMPUTER
INC. AND ITS CUSTOMERS. NO REPRESENTATION OR OTHER AFFIRMATION OF FACT
CONTAINED IN THIS PUBLICATION, INCLUDING BUT NOT LIMITED TO STATEMENTS
REGARDING CAPACITY, RESPONSE-TIME PERFORMANCE, SUITABILITY FOR USE OR
PERFORMANCE OF PRODUCTS DESCRIBED HEREIN SHALL BE DEEMED TO BE A WARRANTY BY
APOLLO COMPUTER INC. FOR ANY PURPOSE, OR GIVE RISE TO ANY LIABILITY BY APOLLO
COMPUTER INC. WHATSOEVER.
IN NO EVENT SHALL APOLLO COMPUTER INC. BE LIABLE FOR ANY INCIDENTAL,
INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING BUT NOT
LIMITED TO LOST PROFITS) ARISING OUT OF OR RELATING TO THIS PUBLICATION OR
THE INFORMATION CONTAINED IN IT, EVEN IF APOLLO COMPUTER INC. HAS BEEN
ADVISED, KNEW OR SHOULD HAVE KNOWN OF THE POSSIBILITY OF SUCH DAMAGES.
THE SOFTWARE PROGRAMS DESCRIBED IN THIS DOCUMENT ARE CONFIDENTIAL INFORMATION
AND PROPRIETARY PRODUCTS OF APOLLO COMPUTER INC. OR ITS LICENSORS.
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.
If you are installing Domain C Version 6.5.mpx, the pathname is the pathname
is
/install/doc/apollo/cc.v.6.5.mpx__notes
If you are installing Domain C Version 6.6.m, the pathname is
/install/doc/apollo/cc.v.6.6.m__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 -P printer_name pathname
iii
Contents
Section
CHAPTER 1 OVERVIEW OF DOMAIN C COMPILER VERSION 6.5 . . . . . . . . . . . . . . 1-1
1.1 New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
1.2 Function Prototypes . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
1.2.1 Prototypes and System Calls . . . . . . . . . . . . . . . . . . . 1-5
1.3 COFF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
1.4 Absolute Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
1.5 Accessing FORTRAN Common Blocks . . . . . . . . . . . . . . . . . . . . 1-6
1.6 Reference Variables . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
1.7 Informational Messages . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
1.8 Differences between /bin/cc and /com/cc . . . . . . . . . . . . . . . . 1-7
1.8.1 Compilation and Linking Process . . . . . . . . . . . . . . . . . 1-8
1.8.2 Different Preprocessors . . . . . . . . . . . . . . . . . . . . . 1-8
1.8.3 Global Variables . . . . . . . . . . . . . . . . . . . . . . . . . 1-9
1.8.4 Command Line Switches . . . . . . . . . . . . . . . . . . . . . . 1-9
1.8.5 Optimization Levels. . . . . . . . . . . . . . . . . . . . . . . . 1-9
CHAPTER 2 INSTALLATION INFORMATION . . . . . . . . . . . . . . . . . . . . . . . 2-1
CHAPTER 3 DOCUMENTATION. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
3.1 Cross-Compilation . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
3.2 -es|-esf and -E|-P Preprocessor Options . . . . . . . . . . . . . . 3-1
3.3 Level 3 and 4 Informational Messages . . . . . . . . . . . . . . . . 3-2
3.4 #attribute Modifier Is Obsolete . . . . . . . . . . . . . . . . . . 3-2
3.5 __STDC__ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
3.6 -frnd, -nfrnd, -abs, and -ac . . . . . . . . . . . . . . . . . . . . 3-3
3.7 builtins.h Header File . . . . . . . . . . . . . . . . . . . . . . . 3-3
3.8 The -M Option for /bin/cc . . . . . . . . . . . . . . . . . . . . . 3-3
3.9 The -A Option for /bin/cc . . . . . . . . . . . . . . . . . . . . . 3-3
CHAPTER 4 BUGS AND BUG FIXES . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
4.1 Fixed Bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
4.2 Known Bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Contents iv
CHAPTER 1
OVERVIEW OF DOMAIN C COMPILER VERSION 6.5
The Version 6.5.mpx Domain C compiler released with SR10.1 enables you to
compile programs on a MC680x0-based machine that can be executed on a Series
10000 Workstation. If you do not plan to cross-compile, you need to install
Version 6.6.m of the C compiler. For information about Version 6.6.m, see
the release notes in install/doc/apollo/cc.v.6.6.m__notes.
Version 6.5.mpx of the C compiler includes some major enhancements and
changes since the SR9.7 release of the compiler. In addition, there are a
few changes since the SR10 release of the compiler. For more information
about SR10 features, consult the Domain__C__Language__Reference (Order No.
002093). For more information about updating old programs, refer to Making
the__Transition__to__SR10__Operating__System__Releases document (Order No.
011435).
If you are currently running Domain C Version 6.0 (released at SR10), you
will find some redundancy between this document and the release document you
received with Version 6.0. Since Domain C Version 6.0, we have introduced
the Series 10000 workstation. Domain C Version 6.5.mpx is designed to take
advantage of this new workstation, and therefore contains some new features.
Most of these new features are described in the Series__10000__Programmer's
Handbook (order no. 011404). In Chapter 3 of these notes, we document a
few additional features. In particular, with Version 6.5.mpx, you can
compile code that will run on a Series 10000 workstation from a 680x0-based
workstation.
NOTE: The -cpu option (with /com/cc) and the -A option (with /bin/cc)
let you specify the processor for which you are generating code. If
you don't use one of these options to specify the target processor,
Domain C generates code for the host processor type (the type of
processor on which the compiler is running).
1-1 Domain C Compiler Version 6.5.mpx
1.1 New Features
The SR10 and SR10.1 versions of the Domain C compiler contain the following
new features:
o New_Object__Code__Format -- At SR10.1, all Domain compilers produce
object modules that are consistent with AT&T's Common Object File
Format (COFF). These object modules are not compatible with object
modules produced by previous releases. To make full use of SR10.0.p
program development tools, you should recompile all source files.
o Function_Prototypes -- Domain C supports function prototypes as
defined in the proposed ANSI standard and in the C++ language.
o Reference_Variables -- Domain C supports reference variables as
implemented in the C++ language.
o Absolute_Code -- Previously, Domain C produced position-independent
code (PIC). At SR10.1, the compiler continues to produce PIC code
for Series 10000 workstations but can produce absolute code for
680x0-based workstations. Absolute code is the default for 680x0
machines. You can still produce position-independent code for a 680x0
machine by specifying the -pic option on the /com/cc command line.
o Generic_Pointers -- The Domain C compiler supports pointers to void,
as defined in the proposed ANSI standard.
o Flexnames -- Identifiers are now unique up to the first 4096
characters.
o UNIX*_Preprocessor__(cpp) -- Domain C now supports the UNIX
preprocessor (cpp) as well as the Aegis preprocessor. For the most
part, the two preprocessors are identical, but there are a few
differences of which you should be aware.
o Cross-Language_Support -- In addition to prototypes and reference
variables, both of which facilitate cross-language support, Domain C
also supports a new #options specifier that enables you to identify
the register in which function return values are to be stored. In
addition, Domain C supports an __attribute[section] modifier that
enables you to create overlay sections. This is particularly useful
when you compile with the /bin/cc command.
o Informational_Messages -- In addition to warnings and errors, the
Domain C compiler now issues informational messages. These messages
identify sections of your source file that will produce inefficient
or non-portable code. You can suppress these messages with the new
-info switch, which is available with the /com/cc command.
o Profiling -- SR10.1 supports profiling of programs via the prof and
gprof utilities. To profile a program, you must compile with the -p
Domain C Compiler Version 6.5.mpx 1-2
or -pg switches (in a a BSD environment), or with the -qg or -qp
switches (in a SysV environment). Note that these switches are
available only with /bin/cc. If you use the /com/cc command, you
must compile with the -profile switch.
o INLIB -- The Aegis inlib command is no longer supported at SR10.1.
To load a shared library, you must specify the -inlib switch when you
compile with /com/cc or bind your program.
___________________________________________________________________________
*UNIX is a registered trademark of AT&T in the USA and other countries.
o Case_of_Global__Names -- Prior to SR10, the Domain C compiler
reversed the case of all global names when writing them to the object
file. At SR10.1, the Domain C compiler emits global names exactly as
they are written. This is consistent with the new versions of Domain
Pascal and Domain FORTRAN, which now convert all global names to
lowercase.
o Cross-Compilation_for__Different__UNIX__Environments -- There is a new
-runtype switch (/com/cc only) that enables you to produce code
for one UNIX environment while compiling in another UNIX
environment. This will improve the performance degradation that was
seen in SR10.
o In-Line_Functions -- The Domain C compiler now supports in-line
routines for some of the standard library functions declared in
<strings.h> and <math.h>. The in-line code produces faster
executable code because it removes the overhead involved in passing
control to external functions. To use the in-line routines, include
the header file <apollo/builtins.h> at the top of your source file.
All of these features are described in detail in the new Domain__C__Language
Reference. The following sections highlight those changes that can produce
unexpected results when you recompile existing programs.
1.2 Function Prototypes
At SR10.1, the Domain C compiler supports function prototypes, as defined in
the proposed ANSI C standard. Prototypes provide two main benefits:
o Prototypes enable the compiler to perform type-checking of function
parameters, which can result in early diagnosis of potential bugs.
o Prototypes turn off the automatic argument promotions (chars and
shorts to ints, and floats to doubles) that are normally performed.
Suppressing these conversions can result in significantly faster
code.
1-3 Domain C Compiler Version 6.5.mpx
Because the compiler expects prototypes for all functions, you may receive
informational messages if your source file contains old-style declarations or
definitions. These messages will be displayed only if your info setting is 1
or greater. For example, suppose the source file, helloworld.c, contains
the following:
main()
{
printf("Hello World\n");
}
If you compile with the SR10.1 Domain C compiler and specify an informational
level greater than zero, you will receive the warnings shown below:
$ /com/cc hello_world.c -info 1
(0002) {
******** Line 2: [info #213] No prototype in scope, default prototype "main(...)"
assumed.
(0003) printf("Hello world\n");
******** Line 3: [info #213] No prototype in scope, default prototype "printf(...)"
assumed.
No errors, No warnings, 2 informational Messages, C Compiler, Rev 6.00
The default prototypes, main(...) and printf(...), have the same semantics as
no prototypes at all. That is, they indicate that the functions take an
unspecified number of arguments of unspecified type.
You can suppress the warnings by compiling with the -ntype switch or by
compiling with an info setting of zero (the default). However, a better way
to suppress the messages is to enter the appropriate prototypes:
int main( void )
{
extern int printf( char *, ... );
printf("Hello World\n");
}
Another way to specify the prototype of printf() is to include the <stdio.h>
header file:
Domain C Compiler Version 6.5.mpx 1-4
#include <stdio.h>
All of the functions in the standard C library are prototyped in the header
files located in /usr/include.
1.2.1 Prototypes and System Calls
To take advantage of the type-checking provided by prototypes, there is a new
set of header files for system calls. These ".h" files are located in
/usr/include/apollo. The old insert files located in /sys/ins that use
std_$call will continue to be supported although they will become obsolete at
a future release. We strongly recommend that you use the new header files
for all new programs and that you convert existing programs as soon as
possible.
In addition to type-checking, the prototypes provide a much cleaner interface
to system routines. In particular, prototypes suppress automatic type
conversions so it is no longer necessary to cast char, short, and float
arguments. Also, the system call prototypes make use of another new feature,
reference variables, which enable you to pass arguments by reference.
Reference variables are described later in this release document.
1.3 COFF
Object files produced by SR10.1 compilers are compatible with the Common
Object File Format specified by AT&T. As a result, these object files are
not compatible with object files produced by previous Domain compilers. When
you recompile, therefore, you should recompile all source modules in a
program. The /bin/ld link editor and the /com/bind binder cannot link COFF
modules with old-style object modules. It is possible for the loader to load
a combination of COFF modules and old-style modules, so you do not
necessarily need to recompile shared libraries. However, we recommend that
you convert all modules to COFF as soon as possible.
1.4 Absolute Code
At SR10.1, all Domain compilers produce absolute code by default for 680x0
workstations. For Series 10000 workstations, the compilers produce
position-independent (PIC) code. The -abs and -ac compiler options (/com/cc)
have no meaning if you are generating code for a Series 10000 workstation.
1-5 Domain C Compiler Version 6.5.mpx
NOTE: If you compile for absolute code and you reference global data in
a shared library, that library must either be installed when compiling,
or else you must specify the library with the -inlib switch.
In addition, there are two cases where you must direct the compiler to
produce position-independent code for a 680x0 machine. These two cases are:
o Routines that will be placed a shared library
o Programs that are dynamically loaded, such as IOS type managers
Use the -pic switch to force the compiler to produce position-independent
code. For example:
$ /com/cc -pic lib_func
All routines in a library must be compiled with the -pic switch. Even if
only one of the routines is composed of absolute code, the entire library
will be loaded as absolute code.
1.5 Accessing FORTRAN Common Blocks
If you have programs that access FORTRAN common blocks, you should be aware
of the new __attribute[section] specifier that enables you to create an
overlay section. This specifier is useful only for programs that you compile
with the /bin/cc command. If you compile with the /com/cc command, the
compiler will automatically create overlay sections for all global variables,
as in the past. Consult Chapter 7 of the Domain_C_Language_Reference for
more information about accessing FORTRAN common blocks.
1.6 Reference Variables
At SR10.1, Domain C supports reference variables, as defined in the C++
language. The most significant impact of this new feature is that the new
prototypes for system calls use reference variables to distinguish between IN
parameters and other types of parameters. IN parameters are declared as
reference variables, enabling you to pass the arguments by reference. All
other parameter are declared as pointers. For instance, the prototype for
ios_$set_dir is:
extern void
ios_$set_dir(
Domain C Compiler Version 6.5.mpx 1-6
char *pname,
pinteger&plen,
ios_$dir_type_t &dir,
status_$t *status
);
This means that plen and dir will be passed by reference, whereas pname and
status will be pointers passed by value. For example, the invocation might
be:
...
char pname[100];
pinteger plen;
ios_$dir_type_t dir;
status_$t status;
...
ios_$set_dir( pname, plen, dir, &status );
Only status requires an ampersand (&) in front of it. pname is the name of
an array, so it is interpreted as a pointer to the beginning of the array;
plen and dir are declared as reference variables, so the compiler
automatically passes their addresses.
1.7 Informational Messages
In addition to warnings and errors, the Domain C compiler now issues a third
class of messages called "informational messages". These messages alert you
to aspects of your program that could be coded more efficiently. By default,
these messages will not be displayed. To see them, you need to compile with
the -info switch set.
1.8 Differences between /bin/cc and /com/cc
Since SR9.0, Domain systems have supported two commands for invoking the
Domain C compiler: /com/cc and /bin/cc. These two commands have always had
slightly different functionality. For example, the two commands accept
different command line options, and #include directives are interpreted
differently depending on which command you use. At SR10.1, the /bin/cc
command includes additional UNIX functionality, which produces a few more
differences between it and /com/cc. In particular, you should be aware of
the differences listed in the following subsections.
1-7 Domain C Compiler Version 6.5.mpx
It is important to understand that you can invoke /bin/cc or /com/cc
regardless of what operating system environment is running. If you are
working in an Aegis shell, you can invoke /com/cc simply by entering the cc
command. If a UNIX environment is installed, you can invoke /bin/cc by
entering the full pathname.
If you are working in a UNIX shell, you will get /bin/cc by default when you
execute the cc command. Executing /com/cc in a UNIX environment can be
more difficult, depending on whether Aegis is installed on your node. If
Aegis is installed, you can execute /com/cc simply by entering the full
pathname. If Aegis is not installed, you can execute the /com/cc command by
using the -Y0 switch:
% cc -Y0 test.c
1.8.1 Compilation and Linking Process
All Domain C source filenames on a /bin/cc command line must end with a ".c"
suffix, and you must specify the full filename. Files compiled by /com/cc
may have any suffix. Moreover, if the filename ends in a ".c" suffix, the
suffix may be omitted on the command line.
The /com/cc command can compile only one source file at a time. The
/bin/cc accepts multiple source filenames on the command line. In addition,
you can specify object files, which are passed to the /bin/ld link editor.
All source modules compiled by /bin/cc must be processed by a linker
(/bin/ld or /com/bind) before being executed. In contrast, modules
compiled by /com/cc that do not contain unresolved global references may be
executed without being linked. Note that the /bin/cc command automatically
invokes the /bin/ld link editor after compiling.
By default, the /bin/cc command produces an executable file named a.out. If
it cannot produce an executable file (because there are unresolved global
symbols), the /bin/cc command creates an object file with a ".o" suffix for
each source file specified on the command line. The /com/cc command always
creates just one file, an object file with a ".bin" suffix. If there are no
unresolved global references, this object file will be executable.
1.8.2 Different Preprocessors
The /bin/cc command invokes the UNIX C preprocessor before invoking the
Domain compiler. This means that you execute /bin/cc with cpp command
Domain C Compiler Version 6.5.mpx 1-8
options. In addition, the two preprocessors evaluate include pathnames
somewhat differently.
If you use /bin/cc, relative pathnames in #include directives are evaluated
with respect to the source file's directory. If you use /com/cc, pathnames
are evaluated with respect to the working directory. This difference has
always existed and is well documented in the Domain_C_Language_Reference; we
mention it here for completeness.
1.8.3 Global Variables
Unlike /com/cc, /bin/cc does not create a named overlay section for every
global variable. If you need to create an overlay section (e.g., to access a
FORTRAN common block) you must use the new __attribute[section] specifier.
1.8.4 Command Line Switches
The /bin/cc and /com/cc commands accept completely different sets of command
switches. See the Domain__C__Language_Reference for complete details about
these options. Keep in mind, however, that the /bin/cc options must be case
correct, whereas that /com/cc options may be written in uppecase or
lowercase. Also note that some /bin/cc options are specific to either BSD or
System V versions of the UNIX system.
1.8.5 Optimization Levels
By default, /com/cc compiles at optimization level 3, whereas /bin/cc
compiles at optimization level 0.
1-9 Domain C Compiler Version 6.5.mpx
CHAPTER 2
INSTALLATION INFORMATION
Domain C is now composed of three different compilers:
With Version... You can run C on a... To generate code for a...
6.6.m 680x0-based workstation 680x0-based workstation
6.5.mpx 680x0-based workstation Series 10000 workstation
6.5.p Series 10000 workstation Series 10000 workstation
Domain C Version 6.5.p runs on a Series 10000 workstation, under SR10.0.p,
and generates code for a Series 10000 workstation.
Domain C Version 6.5.mpx runs on a 680x0-based workstation, under SR10 and
more recent versions of the operating system, and generates code for a Series
10000 workstation. To cross-develop code (that is, to generate code on a
680x0-based workstation that will run on a Series 10000), install this
compiler.
Domain C Version 6.6.m runs on a 680x0-based workstation, under SR10 and more
recent versions of the operating system, and generates code for a 680x0-based
workstation.
You can install the C Compiler Version 6.5.mpx on a user node (one equipped
with monitor and keyboard) or a Domain Server Processor (DSP) that is
running SR10 or a more recent version of the Domain/OS operating system. If
your are installing only Version 6.5.mpx, and not Version 6.6.m, you must
save your current version of cc before doing the installation and then
restore it once the installation is complete. This is because the
installation procedure for Version 6.5.mpx automatically deletes the current
version of the C compiler.
For directions about how to install this product, see the manual {Media
Installation Instructions for Optional Software Products and Custom Tapes
(Order No. 10854).
If the user node or DSP is not running SR10 or a more recent version of the
Domain/OS operating system, follow the appropriate optional software update
procedures as described in Chapter 5 of Installing__Domain__Software (Order
No. 008860 Rev 02).
NOTE: For successful installation of these products, the workstation
must have enough available disk space to store them. Domain C Version
6.5.mpx occupies 2087 blocks. Domain C Version 6.6.m occupies 814
blocks of available disk space. These compilers do not share disk
2-1 Domain C Compiler Version 6.5.mpx
space: if you will install Versions 6.6.m and 6.5.mpx on the same
workstation, for example, you must have a minimum of 2901 blocks of
available disk space.
Domain C Compiler Version 6.5.mpx 2-2
CHAPTER 3
DOCUMENTATION
The SR10 version of the Domain__C_Language_Reference (Order No. 002093)
describes the Domain C language for Software Release SR10. In addition, the
Series__10000_Programmer's_Handbook (Order No. 011404) describes extensions to
the C language for the Series 10000 workstation. This chapter describes
features that are not covered in these two manuals.
3.1 Cross-Compilation
The -A cpu,id option to /bin/cc and the -cpu id option to /com/cc support a
new id value, a88k which creates code for the Series 10000 workstation.
If id is a88k, the preprocessor defines the symbols ISPA88K to be 1 and
ISPM68K to be 0.
In previous releases, the id value "any" created standard M68000 code. Now,
"any" creates standard code for the host processor: if you compile on a
Series 10000 workstation, "any" is equivalent to a88k.
3.2 -es|-esf and -E|-P Preprocessor Options
The /com/cc es|-esf options and the /bin/cc -E|-P preprocessor options both
produce an expanded source file from the original source code.
The difference is that the -es and -E options add line directives to the
expanded source file, while the -esf and -P options explicitly delete the
line directives.
3-1 Domain C Compiler Version 6.5.mpx
3.3 Level 3 and 4 Informational Messages
The -info option provides four levels of informational messages for the
Series 10000 workstations.
Level 3 messages indicate if a pointer is being assigned the address of an
object that is not naturally aligned.
Level 4 messages provide the same information, but the warning is not
suppressed for pointers whose object alignment is specifically declared.
Level 3 and 4 messages are described in Appendix C of the Series_1000
Programmer's_Handbook.
3.4 attribute Modifier Is Obsolete
The #attribute modifier is obsolete and has been replaced with __attribute.
Although #attribute will continue to work correctly, it should be replaced
with __attribute. The attribute specifiers continue to work in the same way
as before but they should be enclosed in parentheses rather than brackets.
For example, #attribute[volatile] becomes __attribute(volatile).
3.5 __STDC__
The help file for the Domain C compiler should read "Also defines __STDC__ to
be 1"; __STDC__ should be all uppercase.
3.6 -frnd, -nfrnd, -abs, and -ac
The -frnd, -nfrnd, -ac, and -pic switches (/com/cc) have no meaning if you
are compiling code for a Series 10000 Workstation. -pic is the default for
Series 10000 code.
Domain C Compiler Version 6.5.mpx 3-2
3.7 builtins.h Header File
Page 6-47 of the Domain__C_Language_Reference states that you must include
<builtins.h> to get the in-line versions of certain functions. The correct
notation for including this header file is: include <apollo/builtins.h>.
3.8 The -M option for /bin/cc
In previous versions of the C compiler, the -M option to /bin/cc was used to
identify the target machine (like -cpu for /com/cc). At SR10, -M is a
preprocessor option that directs the compiler to run only the macro
preprocessor on the named C programs, and to generate Makefile dependencies
and send the result to the standard output. Use the new -A option (described
in the next section) to select a target machine type.
3.9 The -A Option for /bin/cc
The -A option identifies Domain/OS extensions to cc.
-A nansi Do not compile with ANSI rules. This option passes -ntype to
the compiler, and does not define the preprocessor symbol
__STDC__. See the Domain C language Reference for details
about function prototypes.
-A cpu,id Generate code for a particular class of processor; the default
id is any. Values for id are as follows:
a88k Series 10000 code
any Standard M68000 code
160 DSP160 code
460 DSP460 code
660 660 code
90 DSP90 code
330 DN330 code
560 DN560 code
570 DN570 code
580 DN580 code
3000 DN3000 code
4000 DN4000 code
FPX Floating-Point Accelerator Board
PEB Performance Enhancement Board
-A sys[type],sys
3-3 Domain C Compiler Version 6.5.mpx
Define the target system type (sys) for the compiled object;
sys may be one of the following:
any Version independent
bsd4.1 Berkeley version 4.1 (obsolete)
bsd4.2 Berkeley version 4.2
bsd4.3 Berkeley version 4.3
sys3 UNIX System III (obsolete)
sys5 UNIX System V
sys5.3 UNIX System V Release 3
This option replaces the -Tsystype option (which is supplied
for backwards compatibility).
-A run[type],sys
Like -A sys[type],sys this option passes runtype information to
the compiler and linker.
Domain C Compiler Version 6.5.mpx 3-4
CHAPTER 4
BUGS AND BUG FIXES
This chapter describes known bugs and bugs fixed since SR9.7.
4.1 Fixed Bugs
The APRs (Apollo Product Reports) with the following numbers have been fixed:
o 0D886696
Prior to SR10, the stack size was limited to 256K bytes. In SR10 and
later releases, you can specify an unlimited stack size.
o 0D884425
If any source line in a Domain C program was greater than 1024
characters long, the Domain C compiler gave a warning message of
"supplied buffer too small (stream manager/ios)" and did not complete
the compilation. In SR10 and later releases, this line restriction
was removed.
o 0D884446
Prior to SR10, if a filename containing uppercase letters was given
in the line directive within a Domain C source file, and the source
file was compiled using the /sys5/bin/cc compiler, the user was
unable to view the source file while debugging the object code (using
the debug option -src). The debugger was unable to display the
filename given in the line directive and returned the following
message: "source unavailable". This problem with uppercase
filenames was fixed in SR10.
o 0D884854
4-1 Domain C Compiler Version 6.5
Compiler generated labels were not being marked correctly for the
code generator. This was fixed in SR10.
o 0D885804
Functional prototypes were implemented at SR10, thus allowing
argument declarations to be specified in the include files.
o The previous versions of this compiler contained a bug that occurred
when you specified an alignment greater than the default. This bug
no longer exists, but you must recompile any programs that specified
such an alignment.
4.2 Known Bugs
For all known bugs: If a program fails to compile or execute correctly with
optimization level 3 ('-opt 3' or the default), then try optimization level 0
('-opt 0').
The following bugs are known:
o Calling a function through a pointer to a function prototype does
not convert the constant arguments to the correct size.
o Bad code is generated for copying to a structure returned by a
function. When using code of the form
*f() = s;
where s is a structure greater than 8 bytes, and f returns a pointer
to a structure, nothing is assigned.
o There is a compiler bug in evaluating function types in ternary
expressions ( ? :). The following shows the behavior. test_it with
no parameters should call copywR(); test_it with any parameters
should call copyw(). It always calls copyw(). This causes a bug in
ex/vi.
Domain C Compiler Version 6.5 4-2
% cat test_it.c
include <stdio.h>
copywR()
{
printf("copywR\n");
}
copyw()
{
printf("copyw\n");
}
main(ac, av)
int ac;
char **av;
{
(*(ac > 1 ? copywR : copyw))();
}
% cc -o test_it test_it.c
% ./test_it
copyw
% ./test_it 1
copyw
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 The -esf option suppresses the -info option. Using both options
generates a message that there are informational messages, but it
does not display those messages.
o The compiler may issue incorrect alignment warnings for references to
objects that have an incomplete type (for example, references to
structures that have not been fully declared.)
4-3 Domain C Compiler Version 6.5
o The compiler erroneously diagnoses loads and stores of byte-aligned
words and longwords in some cases. The error message looks like this:
*******************************************************
ISC: The IL node kind is: IL_NONE.
*******************************************************
ISC: source line 12: Attempt to load or store a byte-aligned longword.
In the majority of cases, this is a harmless warning, and the
generated code is correct. If the word or longword is long-aligned or
word-aligned at run-time, however, an alignment trap will be taken,
resulting in decreased performance.
If the word or longword is byte-aligned at run-time, then an "odd
address error" will result.
o (Arithmetic or logical) (left or right) shifts by shift counts larger
than 31 may have different behavior on the Series 10000 workstation
than on a MC680x0-based machine. The MC680x0 machines use the
low-order 6 bits of the shift count, whereas the Series 10000 uses
the low-order 5 bits. Thus, shift counts in the range 32 to 63 may
(for example) set the result of the shift to 0 on a MC680x0 machine,
but have no effect on the value being shifted on a Series 10000.
o The previous versions of this compiler contained a bug that occurred
when you specified an alignment greater than the default. This bug
no longer exists, but you must recompile any programs that specified
such an alignment.
o Expressions using &struct will give a -info 4 message about size
changing in different alignment environments even when the size has
not changed.
For example:
typedef struct
{
int i;
short s;
} SI_N __attribute(( aligned(natural) ));
SI_N *ps,
as[4];
...
ps = &as[0]; /* incorrect info 4 message here */
Domain C Compiler Version 6.5 4-4
4-5 Domain C Compiler Version 6.5