Mail Archives: djgpp-workers/1999/08/05/14:25:31
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
- Raw text -