HP C/Fortran getarg question
The C/fortran program (main, Subroutine ftnmain) works correctly
on ibm rs6000 and does not work correctly on hpux 10.0 (new OS
installation). I wonder if anyone can see what makes the HP version
fail here. When I run the program on the HP, I get -1 for the
argument count and a blank character string for the first argument.
HP makefile:
FF= f77
CC = cc
CFLAG = -c -Aa
FFLAG = -c +ppu +U77
chkga: test.o chkfmt.o
f77 +U77 -o chkga test.o chkfmt.o
chkfmt.o: chkfmt.F
$(FF) $(FFLAG) chkfmt.F
test.o: test.c
$(CC) $(CFLAG) test.c
----File chkfmt.F------
Subroutine ftnmain
Character*32 filename
Integer ia, iargc
External iargc, getarg
ia = iargc()
Write (*, *) ia
Call getarg(1, filename)
Write (*, '(a)') filename
End
------EOF------
------File test.c----
#include <stdio.h>
#include <stdlib.h>
int main ( int argc, char *argv[])
{
ftnmain_();
return 0;
Quote:
}
-------EOF-------------
--
____________________________________________________________
Levent Kitis University of {*filter*}ia
Department of Mechanical, Aerospace, and Nuclear Engineering
____________________________________________________________