NetBSD-Bugs archive

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

Re: bin/53742: src/etc/MAKEDEV.tmpl rev 1.196 has duplicate case label

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

From: Robert Elz <kre%munnari.OZ.AU@localhost>
Subject: Re: bin/53742: src/etc/MAKEDEV.tmpl rev 1.196 has duplicate case label
Date: Mon, 26 Nov 2018 12:15:18 +0700

     Date:        Sun, 25 Nov 2018 13:35:00 +0000 (UTC)
     Message-ID:  <>
   | There is a duplicate switch case pattern "apm)" in etc/MAKEDEV.tmpl.
   | I have no idea how sh(1) resolves this (I guess by always using the first,
 Yes, that's even specified.   Case patterns are examined from first
 to last, and the first that matches wins.   If two are identical, either
 they both match (in which case the first will match before the 2nd
 gets a chance) or neither do (in which case the dup is irrelevant).
   | so the second is dead code) or how it is supposed to work, but
   | we should either comment it properly or avoid it.
 What is there now cannot work, or be useful, the 2nd one (the
 one intended for hpcmips according to its comment) might just
 as well be deleted (or renamed hpapm or something).
 But I suspect ta better solution, is that the second apm entry
 should be moved from src/etc/MAKEDEV.tmpl to
 Then when MAKEDEV is constructed, that one will be insterted
 ahead of the MAKEDEV.tmpl one, and override it (using the shell
 behaviour) ... hpcmpis will get its special case, and all other arch's
 will just see the normal one (as that's all that will be there).
 That's what looks to have been intended.   I won't make this change
 though, as I don't have an hpcmips to test that it all works properly.
 (I think I have seen other cases where there are similar overrides
 Comments describing what is happening (in etc.hpcmips/MAKEDEV.conf)
 would probably also be a good idea.

Home | Main Index | Thread Index | Old Index