diff options
| author | Paul Eggert | 2014-05-17 01:11:31 -0700 |
|---|---|---|
| committer | Paul Eggert | 2014-05-17 01:11:31 -0700 |
| commit | 8208d2bf95f924ed810dc06e84fc4c7d5ac004a5 (patch) | |
| tree | b66944645e971c516adfef8f8bc74517bda8dfa1 /src | |
| parent | f63fc858c3d4a7d91ccac850025e407cc57b77fc (diff) | |
| download | emacs-8208d2bf95f924ed810dc06e84fc4c7d5ac004a5.tar.gz emacs-8208d2bf95f924ed810dc06e84fc4c7d5ac004a5.zip | |
Assume C99 or later.
* lib/stdarg.in.h, lib/stdbool.in.h, m4/stdarg.m4, m4/stdbool.m4:
Remove.
* configure.ac (_AC_PROG_CC_C89): Define a dummy, to keep 'configure'
smaller.
(gl_PROG_CC_C99): Use this to get C99 or later.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* admin/merge-gnulib (GNULIB_MODULES): Remove stdarg, stdbool.
(GNULIB_TOOL_FLAGS): Avoid stdarg, stdbool.
* doc/lispref/internals.texi (C Dialect): Document this.
* etc/NEWS: Document this.
* nt/gnulib.mk: Remove stdarg and stdbool modules.
* src/bytecode.c (B__dummy__): Remove.
* src/conf_post.h (bool_bf) [!NS_IMPL_GNUSTEP]: Use bool.
(FLEXIBLE_ARRAY_MEMBER): Now always empty.
* src/dbusbind.c (XD_DEBUG_MESSAGE) [!DBUS_DEBUG]:
* src/regex.c (DEBUG_PRINT): Assume varargs macros.
* src/lisp.h (DEFUN_FUNCTION_INIT): Remove. All uses now assume C99.
Fixes: debbugs:17487
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/bytecode.c | 2 | ||||
| -rw-r--r-- | src/conf_post.h | 20 | ||||
| -rw-r--r-- | src/dbusbind.c | 6 | ||||
| -rw-r--r-- | src/emacs.c | 2 | ||||
| -rw-r--r-- | src/lisp.h | 7 | ||||
| -rw-r--r-- | src/regex.c | 7 |
7 files changed, 23 insertions, 31 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index a89d14bbe23..31fe13e074c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2014-05-17 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Assume C99 or later (Bug#17487). | ||
| 4 | * bytecode.c (B__dummy__): Remove. | ||
| 5 | * conf_post.h (bool_bf) [!NS_IMPL_GNUSTEP]: Use bool. | ||
| 6 | (FLEXIBLE_ARRAY_MEMBER): Now always empty. | ||
| 7 | * dbusbind.c (XD_DEBUG_MESSAGE) [!DBUS_DEBUG]: | ||
| 8 | * regex.c (DEBUG_PRINT): Assume varargs macros. | ||
| 9 | * lisp.h (DEFUN_FUNCTION_INIT): Remove. All uses now assume C99. | ||
| 10 | |||
| 1 | 2014-05-17 Fabrice Popineau <fabrice.popineau@gmail.com> | 11 | 2014-05-17 Fabrice Popineau <fabrice.popineau@gmail.com> |
| 2 | 12 | ||
| 3 | * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Always map new | 13 | * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Always map new |
diff --git a/src/bytecode.c b/src/bytecode.c index f1bdfd9d9c5..f489c74a144 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -292,8 +292,6 @@ enum byte_code_op | |||
| 292 | Bscan_buffer = 0153, /* No longer generated as of v18. */ | 292 | Bscan_buffer = 0153, /* No longer generated as of v18. */ |
| 293 | Bset_mark = 0163, /* this loser is no longer generated as of v18 */ | 293 | Bset_mark = 0163, /* this loser is no longer generated as of v18 */ |
| 294 | #endif | 294 | #endif |
| 295 | |||
| 296 | B__dummy__ = 0 /* Pacify C89. */ | ||
| 297 | }; | 295 | }; |
| 298 | 296 | ||
| 299 | /* Whether to maintain a `top' and `bottom' field in the stack frame. */ | 297 | /* Whether to maintain a `top' and `bottom' field in the stack frame. */ |
diff --git a/src/conf_post.h b/src/conf_post.h index 95b028a66ee..123f4803da5 100644 --- a/src/conf_post.h +++ b/src/conf_post.h | |||
| @@ -34,9 +34,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 34 | 34 | ||
| 35 | #include <stdbool.h> | 35 | #include <stdbool.h> |
| 36 | 36 | ||
| 37 | /* The pre-C99 <stdbool.h> emulation doesn't work for bool bitfields. | 37 | /* The type of bool bitfields. Needed to compile Objective-C with |
| 38 | Nor does compiling Objective-C with standard GCC. */ | 38 | standard GCC. It was also needed to port to pre-C99 compilers, |
| 39 | #if __STDC_VERSION__ < 199901 || NS_IMPL_GNUSTEP | 39 | although we don't care about that any more. */ |
| 40 | #if NS_IMPL_GNUSTEP | ||
| 40 | typedef unsigned int bool_bf; | 41 | typedef unsigned int bool_bf; |
| 41 | #else | 42 | #else |
| 42 | typedef bool bool_bf; | 43 | typedef bool bool_bf; |
| @@ -293,14 +294,11 @@ extern void _DebPrint (const char *fmt, ...); | |||
| 293 | 294 | ||
| 294 | /* To use the struct hack with N elements, declare the struct like this: | 295 | /* To use the struct hack with N elements, declare the struct like this: |
| 295 | struct s { ...; t name[FLEXIBLE_ARRAY_MEMBER]; }; | 296 | struct s { ...; t name[FLEXIBLE_ARRAY_MEMBER]; }; |
| 296 | and allocate (offsetof (struct s, name) + N * sizeof (t)) bytes. */ | 297 | and allocate (offsetof (struct s, name) + N * sizeof (t)) bytes. |
| 297 | #if 199901 <= __STDC_VERSION__ | 298 | |
| 298 | # define FLEXIBLE_ARRAY_MEMBER | 299 | This macro used to expand to something different on pre-C99 compilers. |
| 299 | #elif __GNUC__ && !defined __STRICT_ANSI__ | 300 | FIXME: Remove it, and remove all uses. */ |
| 300 | # define FLEXIBLE_ARRAY_MEMBER 0 | 301 | #define FLEXIBLE_ARRAY_MEMBER |
| 301 | #else | ||
| 302 | # define FLEXIBLE_ARRAY_MEMBER 1 | ||
| 303 | #endif | ||
| 304 | 302 | ||
| 305 | /* Use this to suppress gcc's `...may be used before initialized' warnings. */ | 303 | /* Use this to suppress gcc's `...may be used before initialized' warnings. */ |
| 306 | #ifdef lint | 304 | #ifdef lint |
diff --git a/src/dbusbind.c b/src/dbusbind.c index 8ebc56c72c4..8997e01b068 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c | |||
| @@ -142,10 +142,7 @@ static bool xd_in_read_queued_messages = 0; | |||
| 142 | } while (0) | 142 | } while (0) |
| 143 | 143 | ||
| 144 | #else /* !DBUS_DEBUG */ | 144 | #else /* !DBUS_DEBUG */ |
| 145 | # if __STDC_VERSION__ < 199901 | 145 | # define XD_DEBUG_MESSAGE(...) \ |
| 146 | # define XD_DEBUG_MESSAGE (void) /* Pre-C99 compilers cannot debug. */ | ||
| 147 | # else | ||
| 148 | # define XD_DEBUG_MESSAGE(...) \ | ||
| 149 | do { \ | 146 | do { \ |
| 150 | if (!NILP (Vdbus_debug)) \ | 147 | if (!NILP (Vdbus_debug)) \ |
| 151 | { \ | 148 | { \ |
| @@ -154,7 +151,6 @@ static bool xd_in_read_queued_messages = 0; | |||
| 154 | message ("%s: %s", __func__, s); \ | 151 | message ("%s: %s", __func__, s); \ |
| 155 | } \ | 152 | } \ |
| 156 | } while (0) | 153 | } while (0) |
| 157 | # endif | ||
| 158 | # define XD_DEBUG_VALID_LISP_OBJECT_P(object) | 154 | # define XD_DEBUG_VALID_LISP_OBJECT_P(object) |
| 159 | #endif | 155 | #endif |
| 160 | 156 | ||
diff --git a/src/emacs.c b/src/emacs.c index deebb2280c7..16d91de84a4 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -214,7 +214,7 @@ int initial_argc; | |||
| 214 | static void sort_args (int argc, char **argv); | 214 | static void sort_args (int argc, char **argv); |
| 215 | static void syms_of_emacs (void); | 215 | static void syms_of_emacs (void); |
| 216 | 216 | ||
| 217 | /* C89 needs each string be at most 509 characters, so the usage | 217 | /* C99 needs each string to be at most 4095 characters, and the usage |
| 218 | strings below are split to not overflow this limit. */ | 218 | strings below are split to not overflow this limit. */ |
| 219 | static char const *const usage_message[] = | 219 | static char const *const usage_message[] = |
| 220 | { "\ | 220 | { "\ |
diff --git a/src/lisp.h b/src/lisp.h index f47fb0c2a24..67b26ef91c7 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2654,16 +2654,11 @@ CHECK_NUMBER_CDR (Lisp_Object x) | |||
| 2654 | minargs, maxargs, lname, intspec, 0}; \ | 2654 | minargs, maxargs, lname, intspec, 0}; \ |
| 2655 | Lisp_Object fnname | 2655 | Lisp_Object fnname |
| 2656 | #else /* not _MSC_VER */ | 2656 | #else /* not _MSC_VER */ |
| 2657 | # if __STDC_VERSION__ < 199901 | ||
| 2658 | # define DEFUN_FUNCTION_INIT(fnname, maxargs) (Lisp_Object (*) (void)) fnname | ||
| 2659 | # else | ||
| 2660 | # define DEFUN_FUNCTION_INIT(fnname, maxargs) .a ## maxargs = fnname | ||
| 2661 | # endif | ||
| 2662 | #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ | 2657 | #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ |
| 2663 | Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ | 2658 | Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ |
| 2664 | static struct Lisp_Subr alignas (GCALIGNMENT) sname = \ | 2659 | static struct Lisp_Subr alignas (GCALIGNMENT) sname = \ |
| 2665 | { { PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, \ | 2660 | { { PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, \ |
| 2666 | { DEFUN_FUNCTION_INIT (fnname, maxargs) }, \ | 2661 | { .a ## maxargs = fnname }, \ |
| 2667 | minargs, maxargs, lname, intspec, 0}; \ | 2662 | minargs, maxargs, lname, intspec, 0}; \ |
| 2668 | Lisp_Object fnname | 2663 | Lisp_Object fnname |
| 2669 | #endif | 2664 | #endif |
diff --git a/src/regex.c b/src/regex.c index 622db708b98..ac71b797fbd 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -1190,12 +1190,7 @@ print_double_string (re_char *where, re_char *string1, ssize_t size1, | |||
| 1190 | # define assert(e) | 1190 | # define assert(e) |
| 1191 | 1191 | ||
| 1192 | # define DEBUG_STATEMENT(e) | 1192 | # define DEBUG_STATEMENT(e) |
| 1193 | # if __STDC_VERSION__ < 199901L | 1193 | # define DEBUG_PRINT(...) |
| 1194 | # define DEBUG_COMPILES_ARGUMENTS | ||
| 1195 | # define DEBUG_PRINT /* 'DEBUG_PRINT (x, y)' discards X and Y. */ (void) | ||
| 1196 | # else | ||
| 1197 | # define DEBUG_PRINT(...) | ||
| 1198 | # endif | ||
| 1199 | # define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) | 1194 | # define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) |
| 1200 | # define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) | 1195 | # define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) |
| 1201 | 1196 | ||