HP Fortran Programmer's Guide (B3908-90031; September 2011)

Using Fortran directives
Using HP Fortran directives
Chapter 9212
! Append a null to the string so that C can handle it properly
CALL c_rout(name//char(0))
END PROGRAM main
Here are the command lines to compile and link both files, and to execute the program, along with the output
from a sample run:
$ cc -Aa -c pr_str.c
$ f90 pass_str.f90 pr_str.o
$ a.out
Charlie
For more information
For detailed information about the %REF and %VAL built-in functions, see the HP Fortran Programmer’s
Reference.
$HP$ CHECK_OVERFLOW
The $HP$ CHECK_OVERFLOW directive generates code to trap when an overflow occurs in integer
arithmetic. By default, integer overflow is ignored.
Syntax
!$HP$ CHECK_OVERFLOW INTEGER [ON | OFF]
ON causes the compiler to generate code to trap integer overflow exceptions.
OFF causes the compiler not to generate code to trap integer overflow exceptions.
Description and restrictions
If you use $HP$ CHECK_OVERFLOW with the ON statement, you can cause your program to ignore the
overflow, abort on the overflow, or branch to a trap subroutine. If this directive is not used, the ON statement
has no effect on integer overflow errors.
This directive can appear anywhere in your program. It stays in effect until a subsequent
$HP$ CHECK_OVERFLOW directive changes the status.
For more information
For more information about the ON statement see the HP Fortran Programmer’s Reference.
$HP$ LIST
The $HP$ LIST directive turns on or off the inclusion of subsequent source lines in the listing output.