Re: [PATCH] build: define _DEFAULT_SOURCE if _BSD_SOURCE

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

 



On 10/26/17 12:28 PM, Luis R. Rodriguez wrote:
> ./configure will leave traces of a complaint on config.log when
> _BSD_SOURCE is defined but not _DEFAULT_SOURCE. _BSD_SOURCE is
> deprecated so if defining _BSD_SOURCE also define _DEFAULT_SOURCE.
> 
> From config.log:
> /usr/include/features.h:183:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]

Ok.  Or perhaps a more clear rationale is the preadv(5) manpage
itself:

preadv(), pwritev():
	since glibc 2.19:
		_DEFAULT_SOURCE
	Glibc 2.19 and earlier:
		_BSD_SOURCE

But this is just a feature test macro in a configure script.

What about the code itself, how do we handle this when we
actually use preadv() in the codebase?

-Eric

> Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxxxx>
> ---
>  m4/package_libcdev.m4 | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4
> index fa5b63978797..af2a9631b8ba 100644
> --- a/m4/package_libcdev.m4
> +++ b/m4/package_libcdev.m4
> @@ -137,6 +137,7 @@ AC_DEFUN([AC_HAVE_PREADV],
>    [ AC_MSG_CHECKING([for preadv])
>      AC_TRY_LINK([
>  #define _BSD_SOURCE
> +#define _DEFAULT_SOURCE
>  #include <sys/uio.h>
>      ], [
>           preadv(0, 0, 0, 0);
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux