FreeBSD and Cygwin #define _Noreturn to empty if 'lint' is defined.
Problem reported by Ken Brown in: http://bugs.gnu.org/23640
* doc/posix-headers/stdnoreturn.texi (stdnoreturn.h):
Document problem with lint and _Noreturn.
* lib/diffseq.h (IF_LINT, IF_LINT2):
* lib/fts.c (sccsid):
* lib/getndelim2.c (IF_LINT):
* lib/gl_anylinked_list2.h (gl_linked_iterator)
(gl_linked_iterator_from_to):
* lib/gl_anytree_list2.h (gl_tree_iterator)
(gl_tree_iterator_from_to):
* lib/gl_anytree_oset.h (gl_tree_iterator):
* lib/gl_array_list.c (gl_array_iterator)
(gl_array_iterator_from_to):
* lib/gl_array_oset.c (gl_array_iterator):
* lib/gl_carray_list.c (gl_carray_iterator)
(gl_carray_iterator_from_to):
* lib/idcache.c:
* lib/inet_ntop.c (IF_LINT):
* lib/regcomp.c (build_charclass_op, create_tree):
* lib/regex_internal.c (re_acquire_state)
(re_acquire_state_context):
* lib/trigl.c (rcsid):
* lib/trim.c (IF_LINT):
* lib/vasnprintf.c (IF_LINT):
* lib/verify.h (assume):
Treat GCC_LINT like lint.
+2016-05-30 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use GCC_LINT, not lint
+ FreeBSD and Cygwin #define _Noreturn to empty if 'lint' is defined.
+ Problem reported by Ken Brown in: http://bugs.gnu.org/23640
+ * doc/posix-headers/stdnoreturn.texi (stdnoreturn.h):
+ Document problem with lint and _Noreturn.
+ * lib/diffseq.h (IF_LINT, IF_LINT2):
+ * lib/fts.c (sccsid):
+ * lib/getndelim2.c (IF_LINT):
+ * lib/gl_anylinked_list2.h (gl_linked_iterator)
+ (gl_linked_iterator_from_to):
+ * lib/gl_anytree_list2.h (gl_tree_iterator)
+ (gl_tree_iterator_from_to):
+ * lib/gl_anytree_oset.h (gl_tree_iterator):
+ * lib/gl_array_list.c (gl_array_iterator)
+ (gl_array_iterator_from_to):
+ * lib/gl_array_oset.c (gl_array_iterator):
+ * lib/gl_carray_list.c (gl_carray_iterator)
+ (gl_carray_iterator_from_to):
+ * lib/idcache.c:
+ * lib/inet_ntop.c (IF_LINT):
+ * lib/regcomp.c (build_charclass_op, create_tree):
+ * lib/regex_internal.c (re_acquire_state)
+ (re_acquire_state_context):
+ * lib/trigl.c (rcsid):
+ * lib/trim.c (IF_LINT):
+ * lib/vasnprintf.c (IF_LINT):
+ * lib/verify.h (assume):
+ Treat GCC_LINT like lint.
+
2016-05-29 Bruno Haible <bruno@clisp.org>
secure_getenv: Port to many more platforms.
You cannot assume that @code{_Noreturn} is a reserved word;
it might be a macro.
@item
+When the macro @code{lint} is defined, standard headers define
+@code{_Noreturn} (and therefore @code{noreturn}) to be a macro that
+expands to the empty token sequence on some platforms:
+Cygwin 2.5.1, FreeBSD 10.3.
+@item
On MSVC 9, @code{noreturn} expands to the empty token sequence, to avoid
problems with standard headers that use @code{__declspec (noreturn)}
directly. Although the resulting code operates correctly, the
/* Use this to suppress gcc's "...may be used before initialized" warnings.
Beware: The Code argument must not contain commas. */
#ifndef IF_LINT
-# ifdef lint
+# if defined GCC_LINT || defined lint
# define IF_LINT(Code) Code
# else
# define IF_LINT(Code) /* empty */
/* As above, but when Code must contain one comma. */
#ifndef IF_LINT2
-# ifdef lint
+# if defined GCC_LINT || defined lint
# define IF_LINT2(Code1, Code2) Code1, Code2
# else
# define IF_LINT2(Code1, Code2) /* empty */
#include <config.h>
-#if defined(LIBC_SCCS) && !defined(lint)
+#if defined LIBC_SCCS && !defined GCC_LINT && !defined lint
static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
-#endif /* LIBC_SCCS and not lint */
+#endif
#include "fts_.h"
#endif
/* Use this to suppress gcc's "...may be used before initialized" warnings. */
-#ifdef lint
+#if defined GCC_LINT || defined lint
# define IF_LINT(Code) Code
#else
# define IF_LINT(Code) /* empty */
result.list = list;
result.p = list->root.next;
result.q = &list->root;
-#ifdef lint
+#if defined GCC_LINT || defined lint
result.i = 0;
result.j = 0;
result.count = 0;
result.q = node;
}
-#ifdef lint
+#if defined GCC_LINT || defined lint
result.i = 0;
result.j = 0;
result.count = 0;
result.p = node;
/* End point is past the rightmost node. */
result.q = NULL;
-#ifdef lint
+#if defined GCC_LINT || defined lint
result.i = 0;
result.j = 0;
result.count = 0;
result.p = (start_index < count ? node_at (list->root, start_index) : NULL);
/* End point is the node at position end_index. */
result.q = (end_index < count ? node_at (list->root, end_index) : NULL);
-#ifdef lint
+#if defined GCC_LINT || defined lint
result.i = 0;
result.j = 0;
result.count = 0;
result.p = node;
/* End point is past the rightmost node. */
result.q = NULL;
-#ifdef lint
+#if defined GCC_LINT || defined lint
result.i = 0;
result.j = 0;
result.count = 0;
result.count = list->count;
result.p = list->elements + 0;
result.q = list->elements + list->count;
-#ifdef lint
+#if defined GCC_LINT || defined lint
result.i = 0;
result.j = 0;
#endif
result.count = list->count;
result.p = list->elements + start_index;
result.q = list->elements + end_index;
-#ifdef lint
+#if defined GCC_LINT || defined lint
result.i = 0;
result.j = 0;
#endif
result.count = set->count;
result.p = set->elements + 0;
result.q = set->elements + set->count;
-#ifdef lint
+#if defined GCC_LINT || defined lint
result.i = 0;
result.j = 0;
#endif
result.count = list->count;
result.i = 0;
result.j = list->count;
-#ifdef lint
+#if defined GCC_LINT || defined lint
result.p = 0;
result.q = 0;
#endif
result.count = list->count;
result.i = start_index;
result.j = end_index;
-#ifdef lint
+#if defined GCC_LINT || defined lint
result.p = 0;
result.q = 0;
#endif
/* FIXME: provide a function to free any malloc'd storage and reset lists,
so that an application can use code like this just before exiting:
- #ifdef lint
+ #if defined GCC_LINT || defined lint
idcache_clear ();
#endif
*/
/* Use this to suppress gcc's "...may be used before initialized" warnings.
Beware: The Code argument must not contain commas. */
#ifndef IF_LINT
-# ifdef lint
+# if defined GCC_LINT || defined lint
# define IF_LINT(Code) Code
# else
# define IF_LINT(Code) /* empty */
#endif
/* Build a tree for simple bracket. */
-#ifdef lint
+#if defined GCC_LINT || defined lint
memset (&br_token, 0, sizeof br_token);
#endif
br_token.type = SIMPLE_BRACKET;
re_token_type_t type)
{
re_token_t t;
-#ifdef lint
+#if defined GCC_LINT || defined lint
memset (&t, 0, sizeof t);
#endif
t.type = type;
re_dfastate_t *new_state;
struct re_state_table_entry *spot;
Idx i;
-#ifdef lint
+#if defined GCC_LINT || defined lint
/* Suppress bogus uninitialized-variable warnings. */
*err = REG_NOERROR;
#endif
re_dfastate_t *new_state;
struct re_state_table_entry *spot;
Idx i;
-#ifdef lint
+#if defined GCC_LINT || defined lint
/* Suppress bogus uninitialized-variable warnings. */
*err = REG_NOERROR;
#endif
* ====================================================
*/
-#if defined(LIBM_SCCS) && !defined(lint)
+#if defined LIBM_SCCS && !defined GCC_LINT && !defined lint
static char rcsid[] =
"$NetBSD: k_rem_pio2.c,v 1.7 1995/05/10 20:46:25 jtc Exp $";
#endif
#include "xalloc.h"
/* Use this to suppress gcc's "...may be used before initialized" warnings. */
-#ifdef lint
+#if defined GCC_LINT || defined lint
# define IF_LINT(Code) Code
#else
# define IF_LINT(Code) /* empty */
/* GCC >= 4.0 with -Wall emits unjustified "... may be used uninitialized"
warnings in this file. Use -Dlint to suppress them. */
-#ifdef lint
+#if defined GCC_LINT || defined lint
# define IF_LINT(Code) Code
#else
# define IF_LINT(Code) /* empty */
# define assume(R) ((R) ? (void) 0 : __builtin_unreachable ())
#elif 1200 <= _MSC_VER
# define assume(R) __assume (R)
-#elif (defined lint \
+#elif ((defined GCC_LINT || defined lint) \
&& (__has_builtin (__builtin_trap) \
|| 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))))
/* Doing it this way helps various packages when configured with