[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Petr Sumbera: [Bug-tar] tar 1.23 + verify() macro vs old compiler
From: |
Jim Meyering |
Subject: |
Re: Petr Sumbera: [Bug-tar] tar 1.23 + verify() macro vs old compiler |
Date: |
Mon, 15 Mar 2010 17:39:33 +0100 |
Sergey Poznyakoff wrote:
> Hello,
>
> Forwarded is a user report and a proposed patch. OK to apply?
>
> Regards,
> Sergey
>
> From: Petr Sumbera <address@hidden>
> To: address@hidden
> Date: Mon, 15 Mar 2010 16:37:00 +0100
>
> This is a multi-part message in MIME format.
>
> - --Boundary_(ID_saQ6xP8Er0Imd0fVVI/0wQ)
> Content-type: text/plain; CHARSET=US-ASCII; format=flowed
> Content-transfer-encoding: 7BIT
>
> Hi,
>
> Some older compilers basically wouldn't allow variable declaration
> inside function body. And that's exactly what happens with verify()
> macro and latest tar 1.23.
>
> Please see attached patch.
>
> Thanks,
>
> Petr
>
>
> - --Boundary_(ID_saQ6xP8Er0Imd0fVVI/0wQ)
> Content-type: text/plain; name=inttostr.diff
> Content-transfer-encoding: 7BIT
> Content-disposition: attachment; filename=inttostr.diff
>
> - --- tar-1.23/gnu/inttostr.c.orig Mon Mar 15 08:03:27 2010
> +++ tar-1.23/gnu/inttostr.c Mon Mar 15 08:05:00 2010
> @@ -32,9 +32,9 @@
> inttostr (inttype i, char *buf)
> {
> char *p = buf + INT_STRLEN_BOUND (inttype);
> + verify (TYPE_SIGNED (inttype) == inttype_is_signed);
> *p = 0;
>
> - - verify (TYPE_SIGNED (inttype) == inttype_is_signed);
> #if inttype_is_signed
> if (i < 0)
> {
Hi Sergey,
I don't like to cater to such inferior compilers, and these days,
pre-C99 qualifies, but this change isn't too bad, so go ahead.
I suppose gnulib will have to put up with this for another year or two.
However, it'd be slightly better not to separate the declaration
of "p" and that first use, so please move it one line higher,
so that the verify stmt is the first in the block.