From: Bruno Haible Date: Thu, 18 Dec 2008 01:03:14 +0000 (+0100) Subject: Verify an assumption. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e05f8e319ea340b970d9203e1e3841beae62cb0b;p=pspp Verify an assumption. --- diff --git a/ChangeLog b/ChangeLog index e6af381c2d..122bcfed53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-12-17 Bruno Haible + + * lib/mbsinit.c: Include verify.h. Verify an assumption. + * modules/mbsinit (Depends-on): Add verify. + Suggested by Paul Eggert. + 2008-12-17 Bruno Haible * m4/mbrtowc.m4 (AC_FUNC_MBRTOWC): Renamed from gl_FUNC_MBRTOWC. diff --git a/lib/mbsinit.c b/lib/mbsinit.c index 2753b4175b..81fed5a12b 100644 --- a/lib/mbsinit.c +++ b/lib/mbsinit.c @@ -20,6 +20,8 @@ /* Specification. */ #include +#include "verify.h" + /* Platforms that lack mbsinit() also lack mbrlen(), mbrtowc(), mbsrtowcs() and wcrtomb(), wcsrtombs(). We assume that @@ -34,6 +36,8 @@ - In wc -> mb direction, mbstate_t contains no information. In other words, it is always in the initial state. */ +verify (sizeof (mbstate_t) >= 4); + int mbsinit (const mbstate_t *ps) { diff --git a/modules/mbsinit b/modules/mbsinit index e8a3ef97ec..173adf2f2d 100644 --- a/modules/mbsinit +++ b/modules/mbsinit @@ -8,6 +8,7 @@ m4/mbstate_t.m4 Depends-on: wchar +verify configure.ac: gl_FUNC_MBSINIT