When trying to build memtest86+ with clang in order to determine the availability of strongly typed enums in C (they work with Clang 12-17 in -std=c11 mode, FTR), an interesting warning was present in the compiler output:
../system/hwquirks.c:85:46: warning: overlapping comparisons always evaluate to false [-Wtautological-overlap-compare]
if (cpuid_info.version.extendedModel < 6 && cpuid_info.version.extendedModel > 7) // Not Rev G
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
The && should certainly be a ||.
Also, the comparison just below the aforementioned one:
if (cpuid_info.version.extendedModel == 6 && cpuid_info.version.extendedModel < 9) // Not Desktop
return;
Yes. Rev G are extModel = 6 or 7 so operator should be ||. Second line should be extModel == 6 and Model < 9 to skip PGA Mobile on Socket S1. Will correct that for 7.01.
When trying to build memtest86+ with clang in order to determine the availability of strongly typed enums in C (they work with Clang 12-17 in
-std=c11
mode, FTR), an interesting warning was present in the compiler output:The
&&
should certainly be a||
.Also, the comparison just below the aforementioned one:
looks odd ?