]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Silence unused parameter warning on linux
authorTonu Naks <naks@adacore.com>
Thu, 5 Dec 2024 11:34:24 +0000 (11:34 +0000)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 6 Jan 2025 09:14:46 +0000 (10:14 +0100)
In __gnat_locate_exec_on_path (char *exec_name, int current_dir_on_windows)
the recently added second parameter is for windows only. On non-windows
platforms its usage is removed by the preprocessor and the compiler
reports unused parameter.

gcc/ada/ChangeLog:

* adaint.c: void parameter on non-windows platforms

gcc/ada/adaint.c

index 0b6d4bb6b4e575bd5d8a7f7a33b19f95f6044573..0459956ff5baf63b09417cf21d94fb3902f6fd42 100644 (file)
@@ -3110,6 +3110,10 @@ __gnat_locate_exec_on_path (char *exec_name, int current_dir_on_windows)
   }
 
 #else
+  /* Tell the compiler that we are not going to use this parameter
+     on non-windows platforms. */
+  (void)current_dir_on_windows;
+
   const char *path_val = getenv ("PATH");
 
   /* If PATH is not defined, proceed with __gnat_locate_exec anyway, so we can