From 44a3eaeba04ef78835ca741592c376428ada5f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 2 Dec 2017 10:30:25 +0100 Subject: New upstream version 0.9.8 --- tests/test-stddef.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests/test-stddef.c') diff --git a/tests/test-stddef.c b/tests/test-stddef.c index bfb72a0..5bd2f78 100644 --- a/tests/test-stddef.c +++ b/tests/test-stddef.c @@ -1,5 +1,5 @@ /* Test of substitute. - Copyright (C) 2009-2016 Free Software Foundation, Inc. + Copyright (C) 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -12,13 +12,14 @@ 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 . */ + along with this program. If not, see . */ /* Written by Eric Blake , 2009. */ #include #include +#include #include #include "verify.h" @@ -43,9 +44,12 @@ struct d unlikely to bite real code, we ignore that short-coming. */ /* verify (sizeof offsetof (struct d, e) == sizeof (size_t)); */ verify (sizeof (offsetof (struct d, e)) == sizeof (size_t)); -verify (offsetof (struct d, e) < -1); /* Must be unsigned. */ verify (offsetof (struct d, f) == 1); +/* offsetof promotes to an unsigned integer if and only if sizes do + not fit in int. */ +verify ((offsetof (struct d, e) < -1) == (INT_MAX < (size_t) -1)); + /* Check max_align_t's alignment. */ verify (alignof (double) <= alignof (max_align_t)); verify (alignof (int) <= alignof (max_align_t)); -- cgit v1.2.3