Avoid compilation warnings.
authorEli Zaretskii <eliz@gnu.org>
Wed, 1 Oct 2014 15:34:29 +0000 (18:34 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 1 Oct 2014 15:34:29 +0000 (18:34 +0300)
* main.c (find_and_set_default_shell, main) [WINDOWS32]: Declare
variables 'const char *' to avoid compiler warnings.
* job.c (construct_command_argv_internal) [!NDEBUG]: Declare 'end'
and set it only if NDEBUG is not defined, to avoid compiler
warnings.

job.c
main.c

diff --git a/job.c b/job.c
index d22e26c4a9cd6518294a029d36b809e4d4b7be78..623302632477074c0b04f0a9f13d3187f1356b3f 100644 (file)
--- a/job.c
+++ b/job.c
@@ -2703,7 +2703,9 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
 #endif
   int i;
   char *p;
+#ifndef NDEBUG
   char *end;
+#endif
   char *ap;
   const char *cap;
   const char *cp;
@@ -2807,7 +2809,9 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
 
   /* All the args can fit in a buffer as big as LINE is.   */
   ap = new_argv[0] = argstr = xmalloc (i);
+#ifndef NDEBUG
   end = ap + i;
+#endif
 
   /* I is how many complete arguments have been found.  */
   i = 0;
diff --git a/main.c b/main.c
index 0d43575d8b3139a246b3a482bd0c325e6a260390..7f14cba585814bb95f9c819428d57131495d6275 100644 (file)
--- a/main.c
+++ b/main.c
@@ -890,7 +890,7 @@ find_and_set_default_shell (const char *token)
   int sh_found = 0;
   char *atoken = 0;
   const char *search_token;
-  char *tokend;
+  const char *tokend;
   PATH_VAR(sh_path);
   extern const char *default_shell;
 
@@ -1032,8 +1032,8 @@ main (int argc, char **argv, char **envp)
   unsigned int restarts = 0;
   unsigned int syncing = 0;
 #ifdef WINDOWS32
-  char *unix_path = NULL;
-  char *windows32_path = NULL;
+  const char *unix_path = NULL;
+  const char *windows32_path = NULL;
 
   SetUnhandledExceptionFilter (handle_runtime_exceptions);