pkgsrc-Bugs archive

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

Re: pkg/38051: security/sfs recent patch uses __NetBSD_Prereq__ incorrectly

The following reply was made to PR pkg/38051; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
Subject: Re: pkg/38051: security/sfs recent patch uses __NetBSD_Prereq__ 
Date: Tue, 19 Feb 2008 19:41:28 +0700

     Date:        Mon, 18 Feb 2008 12:20:02 +0000 (UTC)
     Message-ID:  <>
   |    Probably better is just to forget __NetBSD_Prereq__() and simply
   |    test
   |            #elif defined(__NetBSD__) && __NetBSD_Version__ >= 499002400
 I see what happened now, I'm just not running a recent enough -current (or 4.0)
 I make packages to have noticed this before.   The test must be written
 this way, and __NetBSD_Prereq__() ignored, because of the change made to
 <sys/param.h> in version 1.242 of that file, that altered the sense of the
 test (it used to be >= and is now <=)
 That means the macro is useless for testing the system version, as depending
 upon the version (the very thing you don't know) it returns different answers.
 I suspect that the original >= test was probably what was originally
 intended when __NetBSD_Prereq__() was invented - but that might just because
 of the way I rationalised its design when I saw it.   For many uses the
 current (<=) test is certainly more intuitive.
 In any case, there's no way to safely use that macro without testing the
 system version first to see how the macro result needs to be interpreted,
 which would be flat out insane...
 As for __NetBSD_Prereq__() ... it is way too late now to revert the
 change to param.h (it's been changed almost 18 months, and is that way
 in 4.0 I presume), so the only rational thing to do is simply to delete it.
 Any code using it now is broken (unless it is very very very unusual)
 and the best thing to do is to cause compilation/linker errors upon it.
 If a macro or macros are needed for testing __NetBSD_Version__ then new
 ones are needed.

Home | Main Index | Thread Index | Old Index