From 8a9a3ff383d0db4e7df6210677119c99ea226805 Mon Sep 17 00:00:00 2001 From: Paul Eggert
Date: Sun, 18 Oct 2015 09:52:45 -0700 Subject: [PATCH] fts: port to C11 alignof * doc/posix-headers/stdalign.texi (stdalign.h): Document the C11 restriction. * lib/fts.c: Include stddef.h, for max_align_t. (fts_alloc): Align using max_align_t, not FTSENT. * modules/fts (Depends-on): Add stddef. --- ChangeLog | 9 +++++++++ doc/posix-headers/stdalign.texi | 5 +++++ lib/fts.c | 11 ++++++++--- modules/fts | 1 + 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index fcfab70..01a0536 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2015-10-18 Paul Eggert + + fts: port to C11 alignof + * doc/posix-headers/stdalign.texi (stdalign.h): + Document the C11 restriction. + * lib/fts.c: Include stddef.h, for max_align_t. + (fts_alloc): Align using max_align_t, not FTSENT. + * modules/fts (Depends-on): Add stddef. + 2015-10-18 Jim Meyering time_rz: avoid warning from bleeding-edge gcc's -Wnonnull diff --git a/doc/posix-headers/stdalign.texi b/doc/posix-headers/stdalign.texi index 036560d..d8a9bee 100644 --- a/doc/posix-headers/stdalign.texi +++ b/doc/posix-headers/stdalign.texi @@ -30,6 +30,11 @@ parenthesized type. Recent versions of GCC support an extension in which the operand can also be a unary expression, as with @code{sizeof}. The Gnulib substitute does not support this extension. @item +In ISO C11, the operand of @code{alignof}/@code{_Alignof} must be a +complete type. Recent versions of GCC support an extension in which +the operand can also be structure type containing a flexible array +member. The Gnulib substitute does not support this extension. address@hidden @code{_Alignas} and @code{alignas} are not always supported; on platforms lacking support, the macro @code{__alignas_is_defined} is not defined. diff --git a/lib/fts.c b/lib/fts.c index a2f65eb..ea73675 100644 --- a/lib/fts.c +++ b/lib/fts.c @@ -64,6 +64,7 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; #include