GNU bug report logs - #78701
Undeclared reference to access on Windows

Previous Next

Package: libtool;

Reported by: Kirill Makurin <maiddaisuki <at> outlook.com>

Date: Thu, 5 Jun 2025 16:24:02 UTC

Severity: normal

Done: Ileana Dumitrescu <ileanadumitrescu95 <at> gmail.com>

To reply to this bug, email your comments to 78701 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-libtool <at> gnu.org:
bug#78701; Package libtool. (Thu, 05 Jun 2025 16:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kirill Makurin <maiddaisuki <at> outlook.com>:
New bug report received and forwarded. Copy sent to bug-libtool <at> gnu.org. (Thu, 05 Jun 2025 16:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kirill Makurin <maiddaisuki <at> outlook.com>
To: "bug-libtool <at> gnu.org" <bug-libtool <at> gnu.org>
Subject: Undeclared reference to access on Windows
Date: Thu, 5 Jun 2025 16:22:42 +0000
[Message part 1 (text/plain, inline)]
Building libltdl on Windows using clang-cl.exe fails with the following diagnostic:

```
H:/git/libtool/libltdl/ltdl.c(781,19): error: call to undeclared function 'access'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  781 |   int           notfound        = access (filename, R_OK);
      |                                   ^
H:/git/libtool/libltdl/ltdl.c(781,19): note: did you mean 'accept'?
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um\winsock.h(739,19): note: 'accept' declared here
  739 | SOCKET PASCAL FAR accept (
      |                   ^
```

On native Windows (MSVC/mingw), access is declared in io.h, which is not included. (On mingw, it could be indirectly included from
other header files.)

A solution would be to add

```
#if defined (_WIN32) && !defined (__CYGWIN__)
#include <io.h>
#endif
```

on top of libltdl/ltdl.c.

- Kirill Makurin

[Message part 2 (text/html, inline)]

Reply sent to Ileana Dumitrescu <ileanadumitrescu95 <at> gmail.com>:
You have taken responsibility. (Fri, 06 Jun 2025 17:49:01 GMT) Full text and rfc822 format available.

Notification sent to Kirill Makurin <maiddaisuki <at> outlook.com>:
bug acknowledged by developer. (Fri, 06 Jun 2025 17:49:02 GMT) Full text and rfc822 format available.

Message #10 received at 78701-done <at> debbugs.gnu.org (full text, mbox):

From: Ileana Dumitrescu <ileanadumitrescu95 <at> gmail.com>
To: 78701-done <at> debbugs.gnu.org
Cc: Kirill Makurin <maiddaisuki <at> outlook.com>
Subject: Re: bug#78701: Undeclared reference to access on Windows
Date: Fri, 6 Jun 2025 20:47:51 +0300
[Message part 1 (text/plain, inline)]
On 05/06/2025 19:22, Kirill Makurin wrote:
> Building libltdl on Windows using clang-cl.exe fails with the following 
> diagnostic:
> 
> ```
> H:/git/libtool/libltdl/ltdl.c(781,19): error: call to undeclared 
> function 'access'; ISO C99 and later do not support implicit function 
> declarations [-Wimplicit-function-declaration]
>    781 |   int           notfound        = access (filename, R_OK);
>        |                                   ^
> H:/git/libtool/libltdl/ltdl.c(781,19): note: did you mean 'accept'?
> C:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\ 
> \um\winsock.h(739,19): note: 'accept' declared here
>    739 | SOCKET PASCAL FAR accept (
>        |                   ^
> ```
> 
> On native Windows (MSVC/mingw), access is declared in io.h, which is not 
> included. (On mingw, it could be indirectly included from
> other header files.)
> 
> A solution would be to add
> 
> ```
> #if defined (_WIN32) && !defined (__CYGWIN__)
> #include <io.h>
> #endif
> ```
> 
> on top of libltdl/ltdl.c.

Thank you for the bug report and suggested patch! I have applied the
change to ltdl.h, and it is on the development branch [1].

[1] 
https://cgit.git.savannah.gnu.org/cgit/libtool.git/commit/?h=development&id=a26932a36ecb2c3013be0c1e7fdbf2eb9062e845

-- 
Ileana Dumitrescu

GPG Public Key: FA26 CA78 4BE1 8892 7F22 B99F 6570 EA01 146F 7354

[OpenPGP_0x6570EA01146F7354.asc (application/pgp-keys, attachment)]
[OpenPGP_signature.asc (application/pgp-signature, attachment)]

This bug report was last modified today.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.