diff options
| author | Paul Eggert | 2013-05-17 22:32:17 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-05-17 22:32:17 -0700 |
| commit | 31ff141c226d00ce8c85562e7812ff1178cb45ed (patch) | |
| tree | 129202655e89622c0ea695d2993e9134990d29bd /lib-src | |
| parent | bfbe26276d04b1e8aeaec21fea7573ac1135d521 (diff) | |
| download | emacs-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/ChangeLog | 7 | ||||
| -rw-r--r-- | lib-src/etags.c | 13 | ||||
| -rw-r--r-- | lib-src/pop.c | 36 |
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 @@ | |||
| 1 | 2013-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 | |||
| 1 | 2013-05-16 Eli Zaretskii <eliz@gnu.org> | 8 | 2013-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 *); | |||
| 316 | static void Yacc_entries (FILE *); | 316 | static void Yacc_entries (FILE *); |
| 317 | static void just_read_file (FILE *); | 317 | static void just_read_file (FILE *); |
| 318 | 318 | ||
| 319 | static void print_language_names (void); | ||
| 320 | static void print_version (void); | ||
| 321 | static void print_help (argument *); | ||
| 322 | int main (int, char **); | ||
| 323 | |||
| 324 | static compressor *get_compressor_from_suffix (char *, char **); | ||
| 325 | static language *get_language_from_langname (const char *); | 319 | static language *get_language_from_langname (const char *); |
| 326 | static language *get_language_from_interpreter (char *); | ||
| 327 | static language *get_language_from_filename (char *, bool); | ||
| 328 | static void readline (linebuffer *, FILE *); | 320 | static void readline (linebuffer *, FILE *); |
| 329 | static long readline_internal (linebuffer *, FILE *); | 321 | static long readline_internal (linebuffer *, FILE *); |
| 330 | static bool nocase_tail (const char *); | 322 | static bool nocase_tail (const char *); |
| @@ -346,7 +338,6 @@ static void find_entries (FILE *); | |||
| 346 | static void free_tree (node *); | 338 | static void free_tree (node *); |
| 347 | static void free_fdesc (fdesc *); | 339 | static void free_fdesc (fdesc *); |
| 348 | static void pfnote (char *, bool, char *, int, int, long); | 340 | static void pfnote (char *, bool, char *, int, int, long); |
| 349 | static void make_tag (const char *, int, bool, char *, int, int, long); | ||
| 350 | static void invalidate_nodes (fdesc *, node **); | 341 | static void invalidate_nodes (fdesc *, node **); |
| 351 | static void put_entries (node *); | 342 | static 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 |
| 819 | static void | 810 | static _Noreturn void |
| 820 | print_version (void) | 811 | print_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 | ||
| 835 | static void | 826 | static _Noreturn void |
| 836 | print_help (argument *argbuffer) | 827 | print_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 | { |