Commit 4be3dfc5 authored by Paul Eggert's avatar Paul Eggert

* emacsclient.c (IF_LINT): New macro.

(set_local_socket, main): Use it to suppress warnings with
GCC -Wuninitialized.
parent b9170155
......@@ -6,6 +6,9 @@
(set_local_socket, main):
Use const char *, not char *, for pointers that are not assigned
through.
(IF_LINT): New macro.
(set_local_socket, main): Use it to suppress warnings with
GCC -Wuninitialized.
* emacsclient.c: Redo local variables to avoid shadowing problems.
(message, socket_status, start_daemon_and_retry_set_socket):
......
......@@ -112,6 +112,13 @@ char *(getcwd) (char *, size_t);
/* Additional space when allocating buffers for filenames, etc. */
#define EXTRA_SPACE 100
/* Use this to suppress gcc's `...may be used before initialized' warnings. */
#ifdef lint
# define IF_LINT(Code) Code
#else
# define IF_LINT(Code) /* empty */
#endif
/* Name used to invoke this program. */
const char *progname;
......@@ -1191,7 +1198,7 @@ set_local_socket (void)
int default_sock = !socket_name;
int saved_errno = 0;
const char *server_name = "server";
const char *tmpdir;
const char *tmpdir IF_LINT ( = NULL);
if (socket_name && !strchr (socket_name, '/')
&& !strchr (socket_name, '\\'))
......@@ -1493,7 +1500,9 @@ main (int argc, char **argv)
int rl, needlf = 0;
char *cwd, *str;
char string[BUFSIZ+1];
int null_socket_name, null_server_file, start_daemon_if_needed;
int null_socket_name IF_LINT ( = 0);
int null_server_file IF_LINT ( = 0);
int start_daemon_if_needed;
int exit_status = EXIT_SUCCESS;
main_argv = argv;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment