File compiles but produces Memory fault when executed

I run the following
K$ cc -v dtfn.c -o dtfn
Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=x86_64-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)
/usr/libexec/gcc/x86_64-redhat-linux/3.4.6/cc1 -quiet -v dtfn.c -quiet -dumpbase dtfn.c -mtune=k8 -auxbase dtfn -version -o /tmp/ccCjfjZg.s
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../x86_64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/include
/usr/include
End of search list.
GNU C version 3.4.6 20060404 (Red Hat 3.4.6-9) (x86_64-redhat-linux)
compiled by GNU C version 3.4.6 20060404 (Red Hat 3.4.6-9).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
as -V -Qy -o /tmp/ccHube1p.o /tmp/ccCjfjZg.s
GNU assembler version 2.15.92.0.2 (x86_64-redhat-linux) using BFD version 2.15.92.0.2 20040927
/usr/libexec/gcc/x86_64-redhat-linux/3.4.6/collect2 --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o dtfn /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/3.4.6/crtbegin.o -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6 -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6 -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../.. -L/lib/../lib64 -L/usr/lib/../lib64 /tmp/ccHube1p.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-redhat-linux/3.4.6/crtend.o /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crtn.o
oracle@CURRENT-enmcgpd1:/users/oracle

It compiles but will not run. I have attached the .c file.

Any help here will be greatly appreciated

Thanks

Brief explanation of the program would be nice alongwith some typical examples of usage...as for troubleshooting what errors are you getting?

It is a handy date time function. We use it on AIX,Solaris,Windows and even 32bit Red Hat but this 64 bit is prewenting a problem.

K$ dtfn -?

Usage: dtfn [-options] Otto P. Bedrosian V1.20 2006-11-10

Default date format is mm/dd/[yy]yy (US) unless specified otherwise.

If date is not entered, system date is substituted if appropriate.

If 2-digit year is entered it will be expanded to 4-digit using
a rolling window based on system date +10 and -90 years.

Valid range of dates is from 1753 to 2799.

${T1} is date and time in the format 'mm/dd/yyyy hh:mi:ss'.

-A months [mm/dd/yyyy] Adjust the date by the number of months.
-a days [mm/dd/yyyy] Adjust the date by the number of days.
-B [mm/dd/yyyy] Beginning of the week (Sunday) for a date.
-b [mm/dd/yyyy] First workday of the month for a date.
-C [mm/dd/yyyy] Day of century for the date.
-c mm/dd/yyyy [mm/dd/yyyy] Compare date1 and date2. Return (date1 - date2).
-D [mm/dd/yyyy] Name of the day for a date (Monday).
-d [mm/dd/yyyy] Abbreviated name of the day for a date (Mon).
-E [mm/dd/yyyy] End of week (Saturday) for a date.
-e [yyyy] Date of Easter for a year.
-F days [mm/dd/yyyy] Adjust the date by the number of workdays.
-f mm/dd/yyyy [mm/dd/yyyy] Workdays between date1 and date2 (inclusive).
-G minutes [${T1}] Adjust the date/time by minutes ('yyyy-mm-dd hh:mi:ss').
-g minutes [${T1}] Adjust the date/time by minutes ('mm/dd/yyyy hh:mi:ss').
-H [yyyy-mm-dd] Abbreviated name of the day for a date (Mon).
-I [yyyy] Daylight Saving Time spring switchover date for US.
-i [yyyy] Daylight Saving Time fall switchover date for US.
-J JD number Date from Julian Date (2,361,222 - 2,743,738).
-j [mm/dd/yyyy] Julian Date number for the date (1753 - 2799).
-K [mm/dd/yyyy] Number of days in a year 'yyyyddd'.
-k [yy][yy]ddd Date from number of days in a year 'mm/dd/yyyy'.
-L [mm/dd/yyyy] Last day of the month for a date.
-l [mm/dd/yyyy] Last workday of the month for a date.
-M [mm/dd/yyyy] Name of the month for the date (January).
-m [mm/dd/yyyy] Abbreviated name of the month for the date (Jan).
-N [mm/dd/yyyy] Work hours in the month for a date (8 hrs/day).
-n weeks [mm/dd/yyyy] Adjust the date by the number of weeks.
-O [dd-MON-yyyy] Convert date from 'dd-MON-yyyy' to 'mm/dd/yyyy'.
-o [mm/dd/yyyy] Convert date from 'mm/dd/yyyy' to 'dd-MON-yyyy'.
-P hours [mm/dd/yyyy] Adjust the date by work hours (8 hrs/day).
-p mm/dd/yyyy [mm/dd/yyyy] Work hours between date1 and date2 (8 hrs/day).
-Q [yyyy-mm-dd] Quarter from date (yyyy-mm-dd to yyyy_qq).
-q [mm/dd/yyyy] Quarter from date (mm/dd/yyyy to yyyy_qq).
-R ${T1} [${T2}] Elapsed time in seconds (input format 'yyyy-mm-dd').
-r ${T1} [${T2}] Elapsed time in 'hh:mi:ss' (input 'yyyy-mm-dd').
-S System date and time (yyyy-mm-dd hh:mi:ss).
-s System date and time (yyyy-mm-dd hh:mi:ss Day).
-T System date and time (mm/dd/yyyy hh:mi:ss).
-t System date and time (mm/dd/yyyy hh:mi:ss Day).
-U ${T1} [${T2}] Elapsed time between two events in seconds.
-u ${T1} [${T2}] Elapsed time between two events in 'hh:mi:ss'.
-V yyyy-mm-dd Verify date: if ok return (yyyy-mm-dd) else '9'.
-v mm/dd/yyyy Verify date: if ok return (mm/dd/yyyy) else '9'.
-W [yyyy-mm-dd] Day of week (0-6, Sunday=0, Monday=1, Saturday=6).
-w [mm/dd/yyyy] Day of week (0-6, Sunday=0, Monday=1, Saturday=6).
-X [mm/dd/yyyy] Date in format 'yyyymmdd_doy_w_Day'.
-x System date and time in 'yyyymmdd_hhmiss_w_Day'.
-Y [yyyy-mm-dd] Convert date from format yyyy-mm-dd to mm/dd/yyyy.
-y [mm/dd/yyyy] Convert date from format mm/dd/yyyy to yyyy-mm-dd.
-Z [dd-mm-yyyy] Convert date from format dd-mm-yyyy to mm/dd/yyyy.
-? or -h List of options. (dtfn -? > dtfn.txt)
oracle@CURRENT-imgsrv1:/oracle/admin/aep_admin/library
K$ dtfn -s
2008-08-29 16:42:37 Fri

This is it compiled and running on AIX

Recompiled and it works now. It was producing a Memory Fault but it works now.

Thanks