monit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Log warning!


From: Jan-Henrik Haukeland
Subject: Re: Log warning!
Date: 05 Jun 2003 19:41:35 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Civil Service)

Christian Hopp <address@hidden> writes:

> I just moved my monit dev tree to my laptop (debian unstable,
> gcc-3.3).  And it just threw me a warning,
> 
>  monitor.h:391: warning: conflicting types for built-in function `log'
> 
> Of course it referrers to the nonlinear mathematical function, which
> is not even included by us (and not even -lm).
> 
> Shall we change this perfect name to something non-perfect?  What
> about, lprintf (or logprintf) ... a bit long, but isn't it what it's
> about?

Clearly there must be a bug in your debian!? I mean, how is it
possible to have log from math.h included if you do not ask for it!?
Since this looks to be happening in the preprocessor stage it must
mean that some standard interface we include in monit does sub-include
math.h and thereby log. This seems very unlikely and strange because
libmath is a external lib (unless math or some other log function
suddenly has become part of libc on your Debian system).

BTW, I do not think we should replace our 'log' unless it's *really*
necessary; that is, if libc or a lib we need to link with suddenly
should contain a function named log.

If the log name really is from math.h [1] you could "simply"; Make
sure that the offending header is not included. The standard headers
use a standard technique to avoid including subsequent headers by
defining the following at the start of a interface:

 #ifndef _MATH_H
 #define _MATH_H 1
 <blabla>

At the start of monitor.h we could use #define _MATH_H 1 so it's not
included later. (But this *must* be a bug in your debian?)


[1] It would be interesting to know if you could find out how and
which header-file include "log". You could for instance try to run
only the preprocessor and look at the output. Using the -E switch with
gcc stops the compiler after the preprocessing stage.

-- 
Jan-Henrik Haukeland




reply via email to

[Prev in Thread] Current Thread [Next in Thread]