bug-wget
[Top][All Lists]
Advanced

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

Re: implicit declaration of function 'utime' in trailing slashes test


From: Tim Rühsen
Subject: Re: implicit declaration of function 'utime' in trailing slashes test
Date: Fri, 22 Jan 2021 23:47:14 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

Hi Ryan,

./configure scripts are not made for using -Werror in CFLAGS.

This is documented somewhere but (sorry), I am just too tired to search for the URL right now.

Regards, Tim

On 21.01.21 01:34, Ryan Schmidt wrote:
Hi, I'm the maintainer of wget in MacPorts.

In the version of clang included with Xcode 12 and later, implicit declaration 
of functions is an error.

During configure, wget 1.12.1 prints this:

checking whether utime handles trailing slashes on files... no

config.log contains this:

configure:49368: checking whether utime handles trailing slashes on files
configure:49414: ccache /usr/bin/clang -o conftest -DNDEBUG -pipe -Os 
-Werror=implicit-function-declaration -arch x86_64 -I/opt/local/include 
-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 conftest.c  >&5
conftest.c:491:23: error: implicit declaration of function 'utime' is invalid 
in C99 [-Werror,-Wimplicit-function-declaration]
                  if (!utime ("conftest.tmp/", NULL))
                       ^
1 error generated.
configure:49414: $? = 1
configure: program exited with status 1

So the results of this test don't represent what you want them to.

This configure test uses #include <time.h>. The problem goes away if I change that to 
#include <utime.h>. Then configure output is still:

checking whether utime handles trailing slashes on files... no

but config.log then contains:

configure:49368: checking whether utime handles trailing slashes on files
configure:49414: ccache /usr/bin/clang -o conftest -DNDEBUG -pipe -Os 
-Werror=implicit-function-declaration -arch x86_64 -I/opt/local/include 
-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 conftest.c  >&5
configure:49414: $? = 0
configure:49414: ./conftest
configure:49414: $? = 2
configure: program exited with status 2

Now the results of the test are accurate.

I included this patch in the MacPorts wget 1.12.1 port:

https://github.com/macports/macports-ports/blob/13fd7facb9e1ea9e70b79c8c0b429058b9bb8698/net/wget/files/implicit.patch

Of course you'll want to patch m4/utime.m4 instead of configure.



Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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