From e9523ed2520fb65086837f8a407d1a61c5076e35 Mon Sep 17 00:00:00 2001 From: John Marino Date: Sun, 5 Feb 2012 08:00:44 +0100 Subject: [PATCH] CCVER=gcc46: Now builds world and kernel cleanly Starting with gcc 4.5, sbin/restore would break on interactive.c with the complaint that the designated length of the storage array within the adirent union structure was not constant. After three previous proposals on the best way to fix it, this is the one requiring the least code change. (Don't count the spelling correction!) This was the last place the breaks using WORLD_CCVER=gcc46. The kernel builds cleanly. Both the gcc46-built world and kernel load and function normally. suggested-by: vsrinivas --- sbin/restore/interactive.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sbin/restore/interactive.c b/sbin/restore/interactive.c index 75f435abf8..f93175110f 100644 --- a/sbin/restore/interactive.c +++ b/sbin/restore/interactive.c @@ -699,9 +699,12 @@ formatf(struct afile *list, int nentry) struct dirent * glob_readdir(RST_DIR *dirp) { + enum { + ADIRENT_STORAGE_LEN = _DIRENT_RECLEN(NAME_MAX), + }; static union { - uint8_t storage[_DIRENT_RECLEN(NAME_MAX)]; - struct dirent aligment; + uint8_t storage[ADIRENT_STORAGE_LEN]; + struct dirent alignment; } adirent; struct direct *dp; struct dirent *adp; -- 2.41.0