bug-make
[Top][All Lists]
Advanced

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

Re: Build warnings in CVS make 3.81.90


From: Jon Grant
Subject: Re: Build warnings in CVS make 3.81.90
Date: Sun, 20 May 2007 14:36:27 +0100
User-agent: Thunderbird 1.5.0.9 (X11/20070103)

Hi,

Paul Smith wrote on 11/05/07 20:15:
On Sat, 2007-04-28 at 15:26 +0100, Jon Grant wrote:

A wider query relating to these warnings is that since make 3.81 is released now, could we change make to use const's instead of #define'd values, and inline functions instead of #define macro expressions?

No... well, at least not inline.  While I have made the decision to no
longer support pre-ANSI, K&R-only compilers as of 3.82, I'm still
requiring ANSI C89 clean code, and inline is not valid C89.

Ok, well just a change to functions (not using the inline keyword) then.
(Compilers tend to make their own mind up anyway on inlining in my
experience anyway) -- Would you consider patches which replaced macros with
functions?

Const integers are legal of course, but I don't know that they really
add much clarity.

One benefit is the code you see is the code that was compiled. Macros
can be replaced during pre-processing and code editors may not visualise
the value as it ended up being compiled. Also we get types on the thing
being defined etc. My programming books probably have more rational examples.

file.c: In function 'file_timestamp_cons':
file.c:765: warning: comparison of unsigned expression < 0 is always false
file.c:766: warning: comparison between signed and unsigned
file.c:766: warning: comparison of unsigned expression < 0 is always false
file.c:769: warning: comparison of unsigned expression < 0 is always false

I haven't looked at these in a while, but the last time I looked this
warning was actually an integral part of the implementation of these
macros.  In other words, if you fixed the warnings the macros wouldn't
work as designed anymore.  You might look in the ChangeLog.  Paul Eggert
provided these macros so we'd need to discuss any changes with him.

Ok, I'll take a look when I get time.

Kind regards, Jon




reply via email to

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