RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: Ticket 17: Cleanup pre-processor usage: "#if HAVE_" should be "#f [...]

From: rse <rse@rpm5.org>
Date: Sun 29 Jul 2007 - 20:45:15 CEST
Message-Id: <20070729184516.049DA347E6E@rpm5.org>
('binary' encoding is not supported, stored as-is) RPM CVS Repository, Ticket Change Notification http://rpm5.org/cvs ____________________________________________________________________________ Ticket: #17 URL: http://rpm5.org/cvs/tktview?tn=17 Created: 2007-07-01 20:01:16 Creator: rse Contact: - Title: Cleanup pre-processor usage: "#if HAVE_" should be "#f [...] Type: Technology Version: - Subsystem: RPM Severity: 3 Priority: 3 Updated: 2007-07-29 20:45:15 Status: Closed Assigned: rse ____________________________________________________________________________ Description: RPM has dozens of "#if HAVE_XXXX_H" usages in the code. HAVE_XXXX_H are Autoconf defines and those are either defined or not defined. Although they are 1 in case they are defined, they are _undefined_ else (not 0). So they should not be used in value comparisons. Instead one should use defined(HAVE_XXXX_H) or !defined(HAVE_XXXX_H) only. Remarks: _2007-Jul-09 03:35:34 by jbj:_ {linebreak} The usage of HAVE_FOO was consistent when autoconf was first used in rpm in 1998. At that time, the dominant paradigm (likely for a deranged C compiler on some long since deceased uglix platform) was #if HAVE_FOO Otherwise, I personally prefer the style #if defined(HAVE_FOO) and I frequently have to go back to change code I type to the previously dominant style for consistency. Received on Sun Jul 29 20:45:16 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.