Message ID | 20210908225250.3912555-1-aurelien@aurel32.net |
---|---|
State | New |
Headers | show |
Series | posix: Fix attribute access mode on getcwd with GNU extension [BZ #27476] | expand |
* Aurelien Jarno: > There is a GNU extension that allows to call getcwd(NULL, >0). It is > described in the documentation, but also directly in the unistd.h > header, just above the declaration. > > Therefore, do not define the attribute access mode when __USE_GNU is in > used. I think we should drop the attribute unconditionally. Thanks, Florian
diff --git a/posix/unistd.h b/posix/unistd.h index 3dca65732f..506d34d2ec 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -529,7 +529,10 @@ extern int fchdir (int __fd) __THROW __wur; bytes long, unless SIZE == 0, in which case it is as big as necessary. */ extern char *getcwd (char *__buf, size_t __size) __THROW __wur - __attr_access ((__write_only__, 1, 2)); +#ifndef __USE_GNU + __attr_access ((__write_only__, 1, 2)) +#endif + ; #ifdef __USE_GNU /* Return a malloc'd string containing the current directory name.