diff options
author | G. Branden Robinson <g.branden.robinson@gmail.com> | 2023-02-09 16:43:09 -0600 |
---|---|---|
committer | G. Branden Robinson <g.branden.robinson@gmail.com> | 2023-02-09 18:29:48 -0600 |
commit | ccc63e65c723e235fafc5099b383959c92664c38 (patch) | |
tree | 0c796683cd3134ecabc5900fef8b1c9371365d20 /src/include | |
parent | 53b1e75fbfe617b22e363469a36a09b2043143e4 (diff) | |
download | groff-git-ccc63e65c723e235fafc5099b383959c92664c38.tar.gz |
src/include/assert.h: Delete.
Switch to using system's assert.h header file. It is futile to attempt
to preserve compatibility with ISO C90 systems by providing a bespoke
predicate-reporting assert() (a C99 feature) when gnulib, which we
require, itself demands C99. This ensures that `static_assert` remains
defined so that gnulib can use it. Thanks to Bruno Haible for the
consultation.
<https://lists.gnu.org/archive/html/groff/2023-02/msg00034.html>
* src/include/assert.h: Delete.
* src/devices/grodvi/dvi.cpp:
* src/devices/grolbp/lbp.cpp:
* src/devices/grolj4/lj4.cpp:
* src/include/itable.h:
* src/include/stringclass.h:
* src/libs/libbib/linear.cpp:
* src/libs/libbib/search.cpp:
* src/libs/libdriver/printer.cpp:
* src/libs/libgroff/assert.cpp:
* src/libs/libgroff/color.cpp:
* src/libs/libgroff/errarg.cpp:
* src/libs/libgroff/font.cpp:
* src/libs/libgroff/nametoindex.cpp:
* src/libs/libgroff/prime.cpp:
* src/libs/libgroff/relocate.cpp:
* src/libs/libgroff/searchpath.cpp:
* src/preproc/eqn/box.cpp:
* src/preproc/eqn/delim.cpp:
* src/preproc/eqn/pile.cpp:
* src/preproc/eqn/script.cpp:
* src/preproc/html/pre-html.cpp:
* src/preproc/pic/pic.h:
* src/preproc/preconv/preconv.cpp:
* src/preproc/soelim/soelim.cpp:
* src/roff/groff/groff.cpp:
* src/roff/troff/troff.h:
* src/utils/hpftodit/hpftodit.cpp:
* src/utils/indxbib/indxbib.cpp:
* src/utils/lkbib/lkbib.cpp:
* src/utils/lookbib/lookbib.cpp:
* src/utils/tfmtodit/tfmtodit.cpp: Respell "assert.h" inclusion with
angle brackets instead of quotation marks.
Fixes <https://savannah.gnu.org/bugs/?63078>.
* ANNOUNCE: Update bug counts.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/assert.h | 43 | ||||
-rw-r--r-- | src/include/itable.h | 2 | ||||
-rw-r--r-- | src/include/stringclass.h | 2 |
3 files changed, 2 insertions, 45 deletions
diff --git a/src/include/assert.h b/src/include/assert.h deleted file mode 100644 index 754cbe65d..000000000 --- a/src/include/assert.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 1989-2020 Free Software Foundation, Inc. - Written by James Clark (jjc@jclark.com) - -This file is part of groff. - -groff is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation, either version 3 of the License, or -(at your option) any later version. - -groff is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -#ifndef ASSERT_H -#define ASSERT_H - -// C99 requires that the diagnostic emitted by assert() contain the -// failing expression and name of the function in scope. Define our own -// macro to ensure this even in ISO C90 systems that don't. - -void assertion_failed(int, const char *, const char *, const char *); - -inline void do_assert(int expr, int line, const char *file, - const char *func, const char *msg) -{ - if (!expr) - assertion_failed(line, file, func, msg); -} -#endif /* ASSERT_H */ - -#undef assert - -#ifdef NDEBUG -#define assert(ignore) /* as nothing */ -#else -#define assert(expr) do_assert(expr, __LINE__, __FILE__, __func__, \ - #expr) -#endif diff --git a/src/include/itable.h b/src/include/itable.h index 5808f2301..c97db5597 100644 --- a/src/include/itable.h +++ b/src/include/itable.h @@ -16,7 +16,7 @@ for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "assert.h" +#include <assert.h> // 'class ITABLE(T)' is the type of a hash table mapping an integer (int >= 0) // to an object of type T. diff --git a/src/include/stringclass.h b/src/include/stringclass.h index aadf07116..2ba106bf6 100644 --- a/src/include/stringclass.h +++ b/src/include/stringclass.h @@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <string.h> #include <stdio.h> -#include "assert.h" +#include <assert.h> // Ensure that the first declaration of functions that are later // declared as inline declares them as inline. |