[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: coreutils-8.26: a one-line patch
From: |
Pádraig Brady |
Subject: |
Re: coreutils-8.26: a one-line patch |
Date: |
Tue, 24 Jan 2017 11:28:38 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
On 22/01/17 02:30, Pádraig Brady wrote:
> On 22/01/17 01:28, Nelson H. F. Beebe wrote:
>> I had done builds of coreutils-8.26 in early December, but did not get
>> around to looking at build logs until today. I now have 166 builds on
>> 138 systems in our lab, of which 81 passed all tests, and 37 passed
>> enough test to be acceptable, so the new version is now installed on
>> most of the machines in my test lab.
>>
>> However, I found a show-stopper source code error here:
>>
>> % sed -n -e 169p src/copy.c
>> #if HAVE_FALLOCATE
>>
>> That is wrong. It needs to be
>>
>> #if defined(HAVE_FALLOCATE)
>>
>> The reason is that on Red Hat 5 and CentOS 5 systems, lib/config.h
>> gets the setting
>>
>> /* #undef HAVE_FALLOCATE */
>>
>> so HAVE_FALLOCATE is undefined, and expands to an empty string,
>> producing the erroneous preprocessor statement "#if", with no
>> expression.
>
>
> That's a standard idiom though used in other places.
> I.E. it should compile file. We even disable -Wundef to allow
> this common idiom. Is the compile failing here?
> What about other cases like '#if HAVE_FPSETPREC' in numfmt.c?
What must be happening here is that HAVE_FALLOCATE is defined,
but it's defined to nothing,
You can force the same failure in numfmt for example using:
$ make CFLAGS=-DHAVE_FPSETPREC= src/numfmt
src/numfmt.c:36:19: error: #if with no expression
So to find what's defining HAVE_FALLOCATE you could:
$ rm src/copy.o; make CFLAGS='-E -dD' src/copy.o
$ less src/copy.o
thanks,
Pádraig