Module Name: src Committed By: rillig Date: Tue Sep 12 22:08:24 UTC 2023
Modified Files: src/include: assert.h Log Message: assert.h: remove custom macro definitions for lint mode In lint mode, 'assert(cond)' expanded to nothing. This broke code like sqlite that assumes 'assert(cond)' expands to an expression that can be used as operand of the comma operator, as in 'return assert(i > 0), i'. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/include/assert.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/include/assert.h diff -u src/include/assert.h:1.25 src/include/assert.h:1.26 --- src/include/assert.h:1.25 Fri Apr 17 15:22:34 2020 +++ src/include/assert.h Tue Sep 12 22:08:24 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: assert.h,v 1.25 2020/04/17 15:22:34 kamil Exp $ */ +/* $NetBSD: assert.h,v 1.26 2023/09/12 22:08:24 rillig Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -48,11 +48,7 @@ #undef assert #ifdef NDEBUG -# ifndef __lint__ -# define assert(e) (__static_cast(void,0)) -# else /* !__lint__ */ -# define assert(e) -# endif /* __lint__ */ +# define assert(e) (__static_cast(void,0)) #else /* !NDEBUG */ # if __STDC__ # define assert(e) \ @@ -67,11 +63,7 @@ #undef _DIAGASSERT #if !defined(_DIAGNOSTIC) -# if !defined(__lint__) -# define _DIAGASSERT(e) (__static_cast(void,0)) -# else /* !__lint__ */ -# define _DIAGASSERT(e) -# endif /* __lint__ */ +# define _DIAGASSERT(e) (__static_cast(void,0)) #else /* _DIAGNOSTIC */ # if __STDC__ # define _DIAGASSERT(e) \ @@ -85,9 +77,7 @@ #endif /* _DIAGNOSTIC */ -#if defined(__lint__) -#define __assert_function__ (__static_cast(const void *,0)) -#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __assert_function__ __func__ #elif __GNUC_PREREQ__(2, 6) #define __assert_function__ __PRETTY_FUNCTION__