Message-ID: <37A9C40C.ABBC94D5@softhome.net> Date: Thu, 05 Aug 1999 19:04:12 +0200 From: Laurynas Biveinis X-Mailer: Mozilla 4.61 [en] (Win98; I) X-Accept-Language: lt,en MIME-Version: 1.0 To: Eli Zaretskii CC: DJGPP Workers Subject: Re: CPU ID program, second version References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Eli Zaretskii wrote: > > On Thu, 5 Aug 1999, Laurynas Biveinis wrote: > > > > Also, your switch statement is incomplete -- add a default case and > > > call it "ix86" or something like that. > > > > It currently handles all cases - first CPU's with CPUID instruction > > are 486 and Pentiums. And currently there is no CPU which reports > > bigger value in "instruction family" field than 0x6 (for i686). > > Nevertheless, switch statements with no default are generally a bad > idea. A library function shouldn't have undefined behavior in > unforseen circumstances. > > I think returning i486 as the default in the last switch is good > enough. Do you agree? Well, i486 would be a safe bet, but it is more likely that unrecognized CPU will be later than i686. ("i786"?) So returning "i686" as default would be more exact but also *much* more dangerous. Laurynas Biveinis