bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] Fw: tar 1.27.1 compile error on AIX 7.1 TL2 SP3 and AIX 6.


From: Paul Eggert
Subject: Re: [Bug-tar] Fw: tar 1.27.1 compile error on AIX 7.1 TL2 SP3 and AIX 6.1 TL8 SP3 with IBM XL C/C++
Date: Mon, 06 Jan 2014 16:13:34 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Thanks, but your patch would make the resulting program fail to conform
to C89, as C89 requires array sizes to be constant expressions.

I'm still waiting to see if they will consider this as a compiler defect
and if an APAR will be created to eventually.
I'll let you and the mailing list know once I receive this answer.

It's pretty clear that the compiler fails to conform
to the C standard here (C89, C99, C11, whichever version you like),
as the size is an integer constant expression.

Does the following alternative patch work around the problem for you?
If so, I can install it, as it should work regardless of the C
standard version.

diff --git a/src/incremen.c b/src/incremen.c
index f6b311e..d850b68 100644
--- a/src/incremen.c
+++ b/src/incremen.c
@@ -1296,8 +1296,8 @@ void
 show_snapshot_field_ranges (void)
 {
   struct field_range const *p;
-  char minbuf[max (SYSINT_BUFSIZE, INT_BUFSIZE_BOUND (intmax_t))];
-  char maxbuf[max (SYSINT_BUFSIZE, INT_BUFSIZE_BOUND (uintmax_t))];
+  char minbuf[SYSINT_BUFSIZE];
+  char maxbuf[SYSINT_BUFSIZE];
printf("This tar's snapshot file field ranges are\n");
   printf ("   (%-15s => [ %s, %s ]):\n\n", "field name", "min", "max");
@@ -1406,7 +1406,7 @@ write_directory_file_entry (void *entry, void *data)
if (DIR_IS_FOUND (directory))
     {
-      char buf[max (SYSINT_BUFSIZE, INT_BUFSIZE_BOUND (intmax_t))];
+      char buf[SYSINT_BUFSIZE];
       char const *s;
s = DIR_IS_NFS (directory) ? "1" : "0";




reply via email to

[Prev in Thread] Current Thread [Next in Thread]