www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/08/05/12:25:26

Date: Thu, 5 Aug 1999 18:01:23 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Laurynas Biveinis <lauras AT softhome DOT net>
cc: djgpp-workers AT delorie DOT com
Subject: Re: CPU ID program, second version
In-Reply-To: <37A96C09.95FC9A2@softhome.net>
Message-ID: <Pine.SUN.3.91.990805175845.16775A-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019