24.05.2014 Views

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

-qport Option<br />

Syntax<br />

-qport[=suboptions]| -qnoport<br />

PORT[(suboptions)]| NOPORT<br />

The -qport compiler option increases flexibility when porting programs to <strong>XL</strong><br />

<strong>Fortran</strong>, providing a number of options to accommodate other <strong>Fortran</strong> language<br />

extensions. A particular suboption will always function independently of other<br />

-qport and compiler options.<br />

Arguments<br />

hexint | nohexint<br />

If you specify this option, typeless constant hexadecimal strings are<br />

converted to integers when passed as an actual argument to the<br />

INT intrinsic function. Typeless constant hexadecimal strings not<br />

passed as actual arguments to INT remain unaffected.<br />

mod | nomod Specifying this option relaxes existing constraints on the MOD<br />

intrinsic function, allowing two arguments of the same data type<br />

parameter to be of different kind type parameters. The result will<br />

be of the same type as the argument, but with the larger kind type<br />

parameter value.<br />

nullarg | nonullarg<br />

For an external or internal procedure reference, specifying this<br />

option causes the compiler to treat an empty argument, which is<br />

delimited by a left parenthesis and a comma, two commas, or a<br />

comma and a right parenthesis, as a null argument. This suboption<br />

has no effect if the argument list is empty.<br />

Examples of empty arguments are:<br />

call foo(,,z)<br />

call foo(x,,z)<br />

call foo(x,y,)<br />

The following program includes a null argument.<br />

<strong>Fortran</strong> program:<br />

program nularg<br />

real(4) res/0.0/<br />

integer(4) rc<br />

integer(4), external :: add<br />

rc = add(%val(2), res, 3.14, 2.18,) ! The last argument is a<br />

! null argument.<br />

if (rc == 0) then<br />

print *, "res = ", res<br />

else<br />

print *, "number of arguments is invalid."<br />

endif<br />

end program<br />

C program:<br />

int add(int a, float *res, float *b, float *c, float *d)<br />

{<br />

int ret = 0;<br />

if (a == 2)<br />

*res = *b + *c;<br />

<strong>XL</strong> <strong>Fortran</strong> Compiler-Option Reference 217

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!