NetBSD-Bugs archive

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

kern/47445: __NetBSD_Version__ set incorrectly in NetBSD 6.0.1



>Number:         47445
>Category:       kern
>Synopsis:       __NetBSD_Version__ set incorrectly in NetBSD 6.0.1
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 14 15:00:01 +0000 2013
>Originator:     Robert Elz
>Release:        NetBSD 6.0.1
>Organization:
        Prince of Songkla University
>Environment:
System: NetBSD jade.coe.psu.ac.th 5.1_STABLE NetBSD 5.1_STABLE 
(JADE-1.12-20120130) #27: Tue Jan 31 05:20:31 ICT 2012 
kre%jade.coe.psu.ac.th@localhost:/usr/obj/5/kernels/i386/JADE i386
Architecture: i386
Machine: i386
>Description:
        The #define for __NetBSD_Version__ in sys/param.h has a
        defined structure for the value, as dosumented in the
        comments in that file.

 *      #define __NetBSD_Version__ MMmmrrpp00
 * 
 *      M = major version
 *      m = minor version; a minor number of 99 indicates current.
 *      r = 0 (*)
 *      p = patchlevel

        Note that the final 2 digits are expected to be 0's (though
        in practice when it is necessary to alter the value of
        __NetBSD_Version__ while keeping the indicated version
        constant, those digits are sometimes used).

        The correct encoding for NetBSD 6.0.1 would be

                MM=6 mm=0 rr=0 pp=1

        or      600000100

        But what is in sys/param.h on NetBSD 6.0.1 is

#define __NetBSD_Version__      600000001       /* NetBSD 6.0.1 */

        That's wrong, that's NetBSD 6.0 (with one version bump required).
        It was wrong for much of NetBSD 5.0 as well, though NetBSD 5.1.2
        has it right ...

#define __NetBSD_Version__      501000200       /* NetBSD 5.1.2 */

        (So does 5.2, but that's, comparatively, an easy case).

>How-To-Repeat:
        By inspection.

>Fix:
        Obviously nothing can be done for NetBSD 6.0.1 now,
        it has been released, but the value of __NetBSD_Version__
        in the netbsd-6-0 branch should be corrected to be
        the proper value, so it stands some chance of being correct
        when (that is, if) NetBSD 6.0.2 is released.

        It really shouldn't be hard for the few people who ever touch
        this define to read the comments, and get it right, should it?

>Ps:
        While I am here ... __NetBSD_Prereq__ ***STILL** hasn't been
        removed, and is still useless!   Or almost, for the purposes of
        this PR, it does at least show the forumla for converting
        M.m.p into a __NetBSD_Version__ compatible value (but that
        isn't enough value to retain it).



Home | Main Index | Thread Index | Old Index