Re: screen during compile....

Per Hedeland (per@erix.ericsson.se)
8 Apr 1997 20:25:53 GMT

This doesn't seem in any way related to PortMasters, but anyway -

Jake the flake Messinger wrote:
>On Tue, 8 Apr 1997, Ing. Osvaldo Rojas Glez. wrote:
>> In file included from ./radiusd.c:77:
>> protos.h:30: conflicting types for `gettimeofday'
>> /usr/include/sys/time.h:263: previous declaration of `gettimeofday'
>> ./radiusd.c:114: warning: redefinition of `ulong'
>> /usr/local/lib/gcc-lib/sparc-sun-solaris/2.7.2/include/sys/types.h:223:
>> warning: `ulong' previously declared here
>> *** Error code 1
>> make: Fatal error: Command failed for target `radiusd.o'
>
>It looks like "gettimeofday" in the file radiusd.c is not used right based
>on what is in the protos.h file

Nah, they probably agree with eachother, but not with what is in
/usr/include/sys/time.h - see below.

>Also, "ulong" seems to have been redefined after already being defined in
>YOUR types.h file

Gcc's types.h rather, which is a "fixed" version of the system's
/usr/include/sys/types.h - this is "just" a warning though and can
probably be ignored (there aren't that many radically different ways to
define a "ulong":-).

>It would seem that the version of radius you are compiling expects a
>different version of the OS or a different set of libs.
>
>Does that seem right to anyone else? And how does he now fix that?

The problem with gettimeofday, which must be fixed, is most likely a
symptom of the fact that Sun in their infinite wisdom made the initial
versions of Solaris wildly incompatible with SunOS (and many other:-),
and then for each version has introduced *more* "backwards compatibility"
- most software producers tend to do it the other way around...

Thus, noting that the second argument to gettimeofday() has been useless
for quite a while, they just did away with it and decided that the
function should only take one argument, needlessly breaking lots of code
that expected it to take two as it always had. Of course people adapt
and #ifdef their code accordingly for Solaris - only to be trapped again
when recent versions bring *back* the second argument for compatibility
reasons.

The fix would be to make sure that the declaration in protos.h, and the
usage in radiusd.c, agree with the declaration in /usr/include/sys/time.h
- actually the declaration in protos.h can presumably be taken out
altogether. Further questions on the details of this, as well as
complaints about the brokenness of the code, would be best directed to
those that provided it; I gather that this is Ascend - Livingston's
radius (certainly 2.0, 1.16 too I believe) compiles just fine on modern
versions of Solaris.

--Per Hedeland
per@erix.ericsson.se