aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert2013-05-17 22:32:17 -0700
committerPaul Eggert2013-05-17 22:32:17 -0700
commit31ff141c226d00ce8c85562e7812ff1178cb45ed (patch)
tree129202655e89622c0ea695d2993e9134990d29bd /lib-src
parentbfbe26276d04b1e8aeaec21fea7573ac1135d521 (diff)
downloademacs-31ff141c226d00ce8c85562e7812ff1178cb45ed.tar.gz
emacs-31ff141c226d00ce8c85562e7812ff1178cb45ed.zip
Port --enable-gcc-warnings to clang.
* configure.ac (nw): Remove obsolescent warnings. These aren't needed for clang, or for gcc for that matter. (emacs_cv_clang): New var, which tests for clang. Omit warnings that clang is too picky about. (GLIB_DISABLE_DEPRECATION_WARNINGS): Define this; needed for Ubuntu 13.04 + clang + --enable-gcc-warnings. * lib-src/etags.c: Omit unnecessary forward decls. (print_version, print_help): Declare _Noreturn. * lib-src/pop.c (socket_connection) [HAVE_GETADDRINFO]: Simplify. * src/bytecode.c (exec_byte_code): * src/regex.c: Redo diagnostic pragmas to pacify clang, too. * src/dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable. * src/editfns.c (Fencode_time): * src/fileio.c (file_accessible_directory_p): * src/font.c (font_unparse_xlfd): Use '&"string"[index]' instead of '"string" + (index)'. * src/undo.c (user_error): Remove; unused.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog7
-rw-r--r--lib-src/etags.c13
-rw-r--r--lib-src/pop.c36
3 files changed, 24 insertions, 32 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 6ff653b7be6..e565983e147 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,10 @@
12013-05-18 Paul Eggert <eggert@cs.ucla.edu>
2
3 Port --enable-gcc-warnings to clang.
4 * etags.c: Omit unnecessary forward decls.
5 (print_version, print_help): Declare _Noreturn.
6 * pop.c (socket_connection) [HAVE_GETADDRINFO]: Simplify.
7
12013-05-16 Eli Zaretskii <eliz@gnu.org> 82013-05-16 Eli Zaretskii <eliz@gnu.org>
2 9
3 * update-game-score.c [WINDOWSNT]: Include "ntlib.h". 10 * update-game-score.c [WINDOWSNT]: Include "ntlib.h".
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 27a853a954a..f6b173bf465 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -316,15 +316,7 @@ static void Texinfo_nodes (FILE *);
316static void Yacc_entries (FILE *); 316static void Yacc_entries (FILE *);
317static void just_read_file (FILE *); 317static void just_read_file (FILE *);
318 318
319static void print_language_names (void);
320static void print_version (void);
321static void print_help (argument *);
322int main (int, char **);
323
324static compressor *get_compressor_from_suffix (char *, char **);
325static language *get_language_from_langname (const char *); 319static language *get_language_from_langname (const char *);
326static language *get_language_from_interpreter (char *);
327static language *get_language_from_filename (char *, bool);
328static void readline (linebuffer *, FILE *); 320static void readline (linebuffer *, FILE *);
329static long readline_internal (linebuffer *, FILE *); 321static long readline_internal (linebuffer *, FILE *);
330static bool nocase_tail (const char *); 322static bool nocase_tail (const char *);
@@ -346,7 +338,6 @@ static void find_entries (FILE *);
346static void free_tree (node *); 338static void free_tree (node *);
347static void free_fdesc (fdesc *); 339static void free_fdesc (fdesc *);
348static void pfnote (char *, bool, char *, int, int, long); 340static void pfnote (char *, bool, char *, int, int, long);
349static void make_tag (const char *, int, bool, char *, int, int, long);
350static void invalidate_nodes (fdesc *, node **); 341static void invalidate_nodes (fdesc *, node **);
351static void put_entries (node *); 342static void put_entries (node *);
352 343
@@ -816,7 +807,7 @@ etags --help --lang=ada.");
816#ifndef VERSION 807#ifndef VERSION
817# define VERSION "17.38.1.4" 808# define VERSION "17.38.1.4"
818#endif 809#endif
819static void 810static _Noreturn void
820print_version (void) 811print_version (void)
821{ 812{
822 char emacs_copyright[] = COPYRIGHT; 813 char emacs_copyright[] = COPYRIGHT;
@@ -832,7 +823,7 @@ print_version (void)
832# define PRINT_UNDOCUMENTED_OPTIONS_HELP FALSE 823# define PRINT_UNDOCUMENTED_OPTIONS_HELP FALSE
833#endif 824#endif
834 825
835static void 826static _Noreturn void
836print_help (argument *argbuffer) 827print_help (argument *argbuffer)
837{ 828{
838 bool help_for_lang = FALSE; 829 bool help_for_lang = FALSE;
diff --git a/lib-src/pop.c b/lib-src/pop.c
index 1f3f82baa68..a269144c915 100644
--- a/lib-src/pop.c
+++ b/lib-src/pop.c
@@ -1075,28 +1075,22 @@ socket_connection (char *host, int flags)
1075 } 1075 }
1076 } while (ret != 0); 1076 } while (ret != 0);
1077 1077
1078 if (ret == 0) 1078 for (it = res; it; it = it->ai_next)
1079 { 1079 if (it->ai_addrlen == sizeof addr)
1080 it = res; 1080 {
1081 while (it) 1081 struct sockaddr_in *in_a = (struct sockaddr_in *) it->ai_addr;
1082 { 1082 addr.sin_addr = in_a->sin_addr;
1083 if (it->ai_addrlen == sizeof (addr)) 1083 if (! connect (sock, (struct sockaddr *) &addr, sizeof addr))
1084 { 1084 break;
1085 struct sockaddr_in *in_a = (struct sockaddr_in *) it->ai_addr; 1085 }
1086 addr.sin_addr = in_a->sin_addr; 1086 connect_ok = it != NULL;
1087 if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr))) 1087 if (connect_ok)
1088 break; 1088 {
1089 } 1089 realhost = alloca (strlen (it->ai_canonname) + 1);
1090 it = it->ai_next; 1090 strcpy (realhost, it->ai_canonname);
1091 }
1092 connect_ok = it != NULL;
1093 if (connect_ok)
1094 {
1095 realhost = alloca (strlen (it->ai_canonname) + 1);
1096 strcpy (realhost, it->ai_canonname);
1097 }
1098 freeaddrinfo (res);
1099 } 1091 }
1092 freeaddrinfo (res);
1093
1100#else /* !HAVE_GETADDRINFO */ 1094#else /* !HAVE_GETADDRINFO */
1101 do 1095 do
1102 { 1096 {