NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
kern/43063: Please delete __NetBSD_Prereq__() from <sys/param.h>
>Number: 43063
>Category: kern
>Synopsis: Please delete __NetBSD_Prereq__() from <sys/param.h>
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: kern-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Fri Mar 26 12:30:00 +0000 2010
>Originator: Robert Elz
>Release: current (or anything recent)
>Organization:
Prince of Songkla University
>Environment:
System: NetBSD jade.coe.psu.ac.th 4.0_STABLE NetBSD 4.0_STABLE
(JADE-1.696-20080517) #9: Fri May 23 18:55:13 ICT 2008
kre%jade.coe.psu.ac.th@localhost:/usr/obj/4/kernels/JADE i386
Architecture: i386
Machine: i386
>Description:
The __NetBSD_Prereq__() in <sys/param.h> was changed from
testing __NetBSD_Version__ >= m.n to testing
__NetBSD_Version <= m.n in version 1.242 of <sys/param.h>
That is, its sense was entirely reversed. Which is the
correct version is irrelevant now (I kind of believe the
former, but I might be rationalising its intended use based
upon the definition I first saw).
The effect is that it is impossible (in sources outside of
NetBSD's control) for anyone to sanely use this macro, as
they'd have no way of telling which version they were going
to get (or at least, not without doing the test that
the macro is designed to do in another way first...)
It could still be used inside NetBSD, where its usage could be
synchronised with the system, but it isn't - that is, I did a
complete search of all the NetBSD current, and the only reference
to the macro was the one in sys/param.h
That is, it is not used the only place it could safely be used.
If something similar is ever needed, it can be recreated
with a new name, and a safe to use definition. For now,
please delete it, so any external code that might happen to
use the thing (obviously I can't search all the world's code
to check) will fail with a compile error (trivially fixed)
rather than generating an unknowable test, and on some systems
(the ones where the test is the "wrong" way for the application)
bizarre results.
>How-To-Repeat:
By inspection.
>Fix:
ed src/sys/sys/param.h <<!
/__NetBSD_Prereq__/;+2d
w
q
!
Home |
Main Index |
Thread Index |
Old Index