]> Dogcows Code - chaz/tar/commitdiff
Include bounds in forward declaration for xhdr_tab.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 3 Nov 2003 23:03:35 +0000 (23:03 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 3 Nov 2003 23:03:35 +0000 (23:03 +0000)
ChangeLog
src/xheader.c

index aa34520026eb1fb16eff6f897b2f1e90a4992957..cfc8890f7b94caf820e8cac1ad914c40f7d300bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
+2003-11-03  Paul Eggert  <eggert@twinsun.com>
+
+       * src/xheader.c (xhdr_tab): Include bounds in forward declaration,
+       as C89 and C99 require this.
+
 2003-10-26  Paul Eggert  <eggert@twinsun.com>
 
-       * 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  <gray@Mirddin.farlep.net>
index ff046367c4e2dd7cfdaf8aa7dbdf22f53a72b907..aa94c4bf2dfb1575d71565bcb7a9121a01c76500 100644 (file)
@@ -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 },
This page took 0.031482 seconds and 4 git commands to generate.