diff mbox series

[Ada] Fix C miss parentheses warning on Windows

Message ID 20200708145734.GA27653@adacore.com
State New
Headers show
Series [Ada] Fix C miss parentheses warning on Windows | expand

Commit Message

Pierre-Marie de Rodat July 8, 2020, 2:57 p.m. UTC
The C compiler switch -Wparentheses causes the warning suggest
parentheses around '&&' within '||'.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* socket.c [_WIN32] (__gnat_minus_500ms): Parentheses around &&
	operations.  Remove notes about TN in comment.
diff mbox series

Patch

diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c
--- a/gcc/ada/socket.c
+++ b/gcc/ada/socket.c
@@ -808,14 +808,12 @@  int __gnat_minus_500ms() {
     ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
     osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
     // Documentation proposes to use IsWindowsVersionOrGreater(10, 0, 17763)
-    // but it does not compare by the build number (last parameter). See
-    // regression test for RC03-012 in fixedbugs, there are some code to
-    // investigate Windows version API behavior.
+    // but it does not compare by the build number (last parameter).
     GetVersionEx(&osvi);
     return osvi.dwMajorVersion < 10
-        || osvi.dwMajorVersion == 10
-        && osvi.dwMinorVersion == 0
-        && osvi.dwBuildNumber < 17763;
+        || (osvi.dwMajorVersion == 10
+            && osvi.dwMinorVersion == 0
+            && osvi.dwBuildNumber < 17763);
   } else {
     return !IsWindows8OrGreater();
   }