Hi Robert,
Check "man localtime" on your Digital UNIX system, and look at the type of the argument to localtime(). (You may have to use "man -s2 localtime" or "man 2 localtime" to get the man page for the C function. If it doesn't find "localtime", try "ctime" instead.)
On my Solaris system, the argument type is "const time_t *". This is defined in /usr/include/time.h as a typdef to long:
typedef long time_t;
However, msg2archive.c declares "clk" as a long, not a time_t.
To fix this, simply cast the value of "&clk" to the correct value. Because time_t and long are essentially the same (under Solaris), this will generally work.
now = localtime((const time_t *) &clk);
***NOTE***: The type, time_t, may be defined differently (as "long long") on 64-bit architectures!!! A better fix for msg2archive.c would be to use this line in place of "long clk;" near the top of the file:
time_t clk;
I would try changing the definition of "clk" first, then trying the cast second.
Dave
On Tue, 19 Jan 1999, Robert Benites <benites_at_cs.unca.edu> wrote:
>I'm running Digital UNIX 4.0A and 4.0D with hypermail-20b3.
>
>I am having the same compile error as was posted by Craig A Summerhill
><craig_at_cni.org> on 23 October 1998. I didn't see a followup to Craig's
>question and so I thought I see if anyone had a solution to my compile
>error:
>
>cd archive; make all CC="gcc" CFLAGS="-g -O2"
>gcc -g -O2 -DHYPERTEST -o htestmail msg2archive.c
>msg2archive.c:47: conflicting types for `time'
>/usr/local/lib/gcc-lib/alpha-dec-osf4.0a/2.8.1/include/time.h:124: previous declaration of `time'
>msg2archive.c: In function `main':
>msg2archive.c:105: warning: passing arg 1 of `localtime' from incompatible pointer type
>*** Exit 1
>Stop.
>*** Exit 1
>Stop.
>
>I had been using majordomo to do archiving, but in light of the fact
>that the documentation in the archive directory say *not* to allow
>majordomo to do archiving and the fact using the archive feature
>described in the 20b3 installation package to do archving appears to
>be a superior way of handling the archiving of a list, I'd like to
>find out how to get this compile to work.
>
>Thanks -- Bob Benites
Received on Wed 20 Jan 1999 12:02:02 AM GMT
This archive was generated by hypermail 2.2.0 : Thu 22 Feb 2007 07:33:50 PM GMT GMT