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";