Chapter Contents

Previous

Next
SAS/C Compiler Changes in Release 7.50

New Options


New Compiler Options

The SAS/C Compiler accepts a number of options enabling you to alter the way code is generated, the way listing files appear, as well as other aspects of the compilation. This section describes the new compiler options available with Release 7.50 and how they are implemented in various IBM operating systems.

New Options Summary

The following table contains the long and short forms of the new compiler options. This table is an extension of the table labeled, "Compiler Option Equivalents," in Chapter 5, "Compiling C Programs."

Compiler Option Equivalents
Long Form Short Form
archlevel(1*) -arl*
asynsig
-asy
bfp
-mi
coverage
-ec
c99subset
-c9
hugeptrs
-mh
mpsafe
-mp
stkbelow
-mb

* Where l is one of the letters a, b, c, or d.

The following table summarizes all the new compiler options. This table is an extension of the table labeled, "Compiler Options" in Chapter 6, "Compiler Options."

The first column lists the new options in long form for the IBM 370. Capital letters indicate the abbreviation for the option. The second column indicates the default for each option. For the default value of the option, you are referred to the description of the option later in the chapter. The third column indicates how the option is specified from the UNIX System Services (USS) shell. The fourth column indicates whether the option can be negated. An exclamation point (!) means the option can be negated, and a plus sign (+) means it cannot be negated. The description of the digraph option identifies the negated form of the option. The next three columns represent the environments for which an option is implemented. An asterisk (*) indicates the option affects this environment. The Affects Process column names the process that is affected by the option. The C in the Affects Process column indicates that compilation is affected by the option. An asterisk in the Sys column warns that the form or meaning of the option may differ depending on the environment in which the compiler is running.

Note:   If you specify contradictory options under MVS batch, the OpenEdition shell, and CMS, the option specified last is used.  [cautionend]

Compiler Options
OptionName Default USS Negation OS/390 Batch TSO CMS Affects Process Sys
ARChlevel
see description
-Karchlevel=let
+ * * * C
ASYnsig
ASYnsig
-Kasynsig
! * * * C
BFp
NOBFp
-Kbfp
! * * * C
COVerage
NOCOVerage
-Kcoverage
! * * * C
C99Subset
NOC99Subset
-Kc99subset
! * * * C
HUgeptrs
NOHUgeptrs
-Khugeptrs
! * * * C
MPsafe
MPsafe
-Kmpsafe
! * * * C
STKbelow
NOSTKbelow
-Kstkbelow
! * * * C
STMap
STMap
-Kstmap
! * *
*


New Options

archlevel (-Karchlevel=let under USS)
allows you to request code generation for a specific level of the 390 architecture. By specifying this option, you can exploit newer features of recent processors, but you should be aware that the generated code will fail if you run it on a processor that does not have the indicated feature.

The archlevel option specifies an architectural level by a single-letter code. Four codes are supported currently, with the following meanings.
a The processor supports the logical string assist facility. This facility allows the compiler to generate better code for string.h built-in functions such as strlen, strcpy, and strcmp.
b The processor supports the immediate and relative instruction set, as well as the compare and move extended facility. This allows the compiler to generate improved code in many areas.
c The processor supports the floating-point extensions feature. This feature allows the compiler to generate improved code for floating-point computations, and is required to use IEEE floating-point. Note that use of archlevel(c) is advantageous for programs which use the traditional 390 hex format for floating-point as well as for IEEE applications.
d The processor supports the z/Architecture. This feature allows the compiler to exploit 64-bit registers for programs which use the long long data type, and is a prerequisite for 64-bit addressing support.

Note:   The codes are cumulative so that, for instance, specifying an architecture level of c indicates presence of all features defined for levels a and b,as well as c.  [cautionend]

If no architecture level is specified, the compiler assumes that none of the above architectural features can be used. However, if the bfp option is specified, an archlevel of c is assumed by default, and if the hugeptrs option is specified, the archlevel is assumed to be d.

In TSO and under MVS batch, the archlevel option is specified as follows:

archlevel(let)

For example, the following indicates that the compiler can assume the presence of the floating-point extensions:

archlevel(c)

asynsig (-Kasynsig under USS)
specifies that extra code should be generated when necessary to detect asynchronous signals on exit from a function. If the program does not use any asynchronous signals (such as SIGINT, SIGALRM, or any POSIX signal), you can improve performance slightly by specfying noasynsig.

If noasynsig is specified but the program responds to asynchronous signals, detection of these signals by the program may be delayed, which causes the handler to be called later than otherwise would be expected.

bfp (-Kbfp under USS)
specifies that the default floating point format is binary (IEEE). Note that the BFP option implies the ARCHLEVEL(C) option.

coverage (-Kcoverage under USS)
activates the COVERAGE feature of the compiler, which provides information on which lines of code written in C were executed at runtime. Use of the coverage option increases code size and execution time in order to support tracking of the executed code. Note that the effective use of the coverage option requires the user to provide a _ _cvgtrm routine to output the accumulated coverage data.

c99subset (-Kc99subset under USS)
enables the following new features of the ISC C99 standard:

hugeptrs (-Khugeptrs under USS)
specifies that the object code is intended to execute in 64-bit addressing mode. When hugeptrs is specified, the default pointer type is _ _huge, and the size of signed and unsigned long data is 8 bytes. Note that the hugeptrs option implies the ARCHLEVEL(D) option.

Though the hugeptrs option is valid under CMS, the object code generated with this option cannot be executed under CMS because of operating system limitations.

mpsafe (-Kmpsafe under USS)
specifies that extra code should be generated to assure correct behavior when a SAS/C asynchronous signal is detected on a different processor in an MP configuration than the one executing the SAS/C program. An example would be a user-added asynchronous signal which is generated by a subtask of the SAS/C program. mpsafe causes a slight performance penalty in the function epilog, so it should be used only when the object code may be used in the presence of such asynchronous signals.

If nompsafe is specified or defaulted, an asynchronous signal generated on another processor may be ignored or may cause an ABEND if it occurs while the function is returning.

stkbelow (-Kstkbelow under USS)
causes the stack frame for functions to be allocated below the 16M line. If the _stkabv external variable has been set to indicate the the program wants to have the stack above the line, but certain functions cannot tolerate this (for example, stack variables will be passed to system services that run only AMODE=24), then stkbelow can be specified to force the auto variables of such functions to be allocated below the line. For assembler routines, the STKBELOW=YES option of the CENTRY macro will accomplish the same result. For best results, use stkbelow to compile only those functions that require a stack below the line.

STMap (-Kstmap under USS
requests that a map of structure elements and their offsets be generated in the cross-reference for each structure tag enclosed. Specifying the -Kstmap option implies the -Kxref option.


New Preprocessor Symbols

The following table contains the new option names, symbols, and corresponding values for those new options that are assigned preprocessor symbols by the compiler. This table is an extension of the table labeled "Preprocessor Symbols" in Chapter 6, "Compiler Options."

Preprocessor Symbols
Option Symbol Value
archlevel unspecified
_O_ARCHLEVEL
0
archlevel(a)
_O_ARCHLEVEL
1
archlevel(b)
_O_ARCHLEVEL
2
archlevel(c)
_O_ARCHLEVEL
3
archlevel(d)
_O_ARCHLEVEL
4
bfp _O_BFP 1
nobfp _O_BFP 0
c99subset _O_C99SUBSET 1
noc99subset _O_C99SUBSET 0
hugeptrs _O_HUGEPTRS 1
nohugeptrs _O_HUGEPTRS 0


New COOL Options


COOL Options Summary

The following table contains the long and short forms of the new compiler options. This table is an extension of the table labeled, "COOL Options Equivalents," in Chapter 7, "Linking C Programs."

COOL Options Equivalents
Long Form Short Form
coverage
none
severe
-we

The following table lists the new options available for the COOL utility and the systems to which these options apply. This table is an extension of the table labeled, "COOL Options," in Chapter 7, "Linking C Programs."

Compiler Options
OptionName TSO CMS OS/390Batch USS
coverage
X X X X
severe
X X X X


COOL Options

coverage (-Kcoverage under USS)
activates the COVERAGE feature of the compiler, which provides information on which lines of code written in C were executed at runtime. Use of the coverage option increases code size and execution time in order to support tracking of the executed code. Note that the effective use of the coverage option requires the user to provide a _ _cvgtrm routine to output the accumulated coverage data.

severe (-Asevere under USS)
causes COOL to assign the same level of importance to warnings as it does to errors. If COOL returns a warning, the COOL return code will be the same as if COOL had returned an error; however, the message the user receives for a warning will remain the same as before. It will indicate only that COOL has returned a warning, not an error.


New DSECT2C Options

In Appendix 1, "The DSECT2C Utility," add the following options to the table labeled, "DSECT2C Options."

DSECT2C Options
Option Explanation
-mh
DSECT2C generates output that explicitly specifies the _ _near qualifier when declaring object pointer types. This allows such types to be compiled correctly without depending on the setting of the HUGEPTRS compiler option. The _ _huge keyword is always used for 64-bit pointer types.
-mi
DSECT2C generates output that explicitly specifies the _ _hexfmt keyword on floating point types. This allows such types to be compiled correctly when the BFP compile option is specified. The _ _binfmt keyword is always used for binary floating-point types.


New Run-Time Option

The run-time option, =rsntrace is new for Release 7.50. Add the following information for =rsntrace to Chapter 9, "Run-Time Argument Processing."

Add the following entry to the table labeled, "General Run-Time Options:"

option negation int _options int _negopts
=rsntrace
=norsntrace
_RSNTRACE
_NORSNTRACE

Add the following entry to the list of options that follows the table labeled, "General Run-Time Options:"

=rsntrace
=r
requests that library diagnostics include infomation about failing operating system calls. If =rsntrace is specified, whenever a library diagnostic message is printed, the library's system macro information (see the SAS/C Library Reference, Volume 1) is checked to see whether a system macro failure has been recorded. If so, information about the failure is added to the message. It is possible that the failure is not related to the contents of the message; however, in many cases it will be, and the additional information may be helpful in problem determination. In particular, this option can be useful in debugging applications such as socket programs, which are often sensitive to configuration problems that manifest themselves as unusual or misleading failure conditions.

In the section titled, "Program specification," add the following entry to the list of currently implemented options:
_RSNTRACE annotates library messages with system macro information.

In the section titled, "Program specification," add the following entry to the list of currently implemented options for _negopts:
_NORSNTRACE does not annotate library messages with system macro information.


Chapter Contents

Previous

Next

Top of Page

Copyright © 2004 by SAS Institute Inc., Cary, NC, USA. All rights reserved.