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++

2014-01-13 Thread yaberger
On 01/07/2014 11:17 AM, Paul Eggert wrote:
 Thanks, I've pushed the patch into the tar master.

Fyi, I've received the following comment from IBM Support:
... we plan on fixing the original problem. We have a fix in mind 
that we are currently testing.
I will provide you with an update by Monday, January 20th, 2014. 


Best regards,

Yannick Bergeron
Advisory IT Specialist

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++

2014-01-07 Thread yaberger
Hi Paul,

Your suggested workaround also works.
I'll inform IBM support of your concern regarding the compiler C standard 
and will see what they say.


Best regards,

Yannick Bergeron
Advisory IT Specialist



From:   Paul Eggert egg...@cs.ucla.edu
To: Yannick Y Bergeron/Bromont/IBM@IBMCA, 
Cc: bug-tar@gnu.org
Date:   01/06/2014 07:13 PM
Subject:Re: Fw: [Bug-tar] tar 1.27.1 compile error on AIX 7.1 TL2 
SP3 and AIX 6.1 TL8 SP3 with IBM XL C/C++



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;




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++

2014-01-07 Thread Paul Eggert
On 01/07/2014 09:55 AM, Yannick Y Bergeron wrote:

 Your suggested workaround also works.
 I'll inform IBM support of your concern regarding the compiler C standard and 
 will see what they say. 

Thanks, I've pushed the patch into the tar master.



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++

2014-01-06 Thread Paul Eggert

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;