Fix compiler warning in cpuinfo for non-x86 architectures
authorErik Lindahl <erik@kth.se>
Fri, 18 Dec 2015 12:30:45 +0000 (13:30 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sat, 19 Dec 2015 05:09:00 +0000 (06:09 +0100)
To make the code cleaner executeX86CpuID() is always defined,
but we should make sure to always return a result code even
on non-x86 (even though it will never be called there).

Change-Id: Ic302945c7794576aa931250a513120c72be62d21

src/gromacs/hardware/cpuinfo.cpp

index 2c0a6d884843f2013ddc21132a591b760705ff53..29fc25520e388d27cf382111ffed3af575740be0 100644 (file)
@@ -187,15 +187,25 @@ executeX86CpuID(unsigned int     gmx_unused level,
 
 #    else
 
-    // No compiler support for cpuid if we get here
+    // We are on x86, but without compiler support for cpuid if we get here
     *eax = 0;
     *ebx = 0;
     *ecx = 0;
     *edx = 0;
     return 1;
 
-#    endif // gcc inline asm, msvc, or no cpuid support
-#endif     // x86
+#    endif  // check for inline asm on x86
+
+#else
+
+    // We are not on x86
+    *eax = 0;
+    *ebx = 0;
+    *ecx = 0;
+    *edx = 0;
+    return 1;
+
+#endif      // x86
 }