From: Paul Eggert Date: Mon, 3 Nov 2003 23:03:35 +0000 (+0000) Subject: Include bounds in forward declaration for xhdr_tab. X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=761802e87ab7e58f4216454257f6b451ee056dfa;p=chaz%2Ftar Include bounds in forward declaration for xhdr_tab. --- diff --git a/ChangeLog b/ChangeLog index aa34520..cfc8890 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ +2003-11-03 Paul Eggert + + * src/xheader.c (xhdr_tab): Include bounds in forward declaration, + as C89 and C99 require this. + 2003-10-26 Paul Eggert - * system.c (sys_spawn_shell): Cast trailing null to (char *). + * src/system.c (sys_spawn_shell): Cast trailing null to (char *). Bug reported by Christian Weisgerber. 2003-10-19 Sergey Poznyakoff diff --git a/src/xheader.c b/src/xheader.c index ff04636..aa94c4b 100644 --- a/src/xheader.c +++ b/src/xheader.c @@ -36,7 +36,10 @@ struct xhdr_tab void (*decoder) (struct tar_stat_info *, char const *); }; -static struct xhdr_tab const xhdr_tab[]; +/* This declaration must specify the number of elements in xhdr_tab, + because ISO C99 section 6.9.2 prohibits a tentative definition that + has both internal linkage and incomplete type. */ +static struct xhdr_tab const xhdr_tab[13]; static struct xhdr_tab const * locate_handler (char const *keyword) @@ -420,6 +423,9 @@ static struct xhdr_tab const xhdr_tab[] = { { "uid", uid_coder, uid_decoder }, { "uname", uname_coder, uname_decoder }, + /* The number of entries in xhdr_tab must agree with the array + bounds in xhdr_tab's forward declaration. */ + #if 0 /* GNU private keywords (not yet implemented) */ /* Sparse file handling */ { "GNU.sparse.offset", sparse_offset_coder, sparse_offset_decoder },