NetBSD Problem Report #47445

From kre@munnari.OZ.AU  Mon Jan 14 14:56:41 2013
Return-Path: <kre@munnari.OZ.AU>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id AAD0263E893
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 14 Jan 2013 14:56:41 +0000 (UTC)
Message-Id: <201301141455.r0EEtI2q013810@jade.coe.psu.ac.th>
Date: Mon, 14 Jan 2013 21:55:18 +0700 (ICT)
From: kre@munnari.OZ.AU
To: gnats-bugs@gnats.NetBSD.org
Subject: __NetBSD_Version__ set incorrectly in NetBSD 6.0.1
X-Send-Pr-Version: 3.95

>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:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 14 15:00:01 +0000 2013
>Closed-Date:    Sun Jul 20 20:46:45 +0000 2014
>Last-Modified:  Sun Jul 20 20:46:45 +0000 2014
>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:/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).

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 20 Jul 2014 20:46:45 +0000
State-Changed-Why:
Currently all the -6 and -5 branches appear to have been corrected,
except for -5-0, which is EOL'd anyway. So I think we can close this.
As for __NetBSD_Prereq__, I'm still trying...


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.