This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Reject invalid definitions of _POSIX_CHOWN_RESTRICTED, _POSIX_NO_TRUNC, _POSIX_VDISABLE
- From: Samuel Thibault <samuel dot thibault at ens-lyon dot org>
- To: libc-alpha at sourceware dot org
- Date: Mon, 29 Jan 2018 00:02:13 +0100
- Subject: Re: [PATCH] Reject invalid definitions of _POSIX_CHOWN_RESTRICTED, _POSIX_NO_TRUNC, _POSIX_VDISABLE
- Authentication-results: sourceware.org; auth=none
- References: <87o9ld3lxz.fsf@linux-m68k.org> <20180128225051.GA1082@altlinux.org>
Dmitry V. Levin, on lun. 29 janv. 2018 01:50:51 +0300, wrote:
> > case _PC_VDISABLE:
> > -#ifdef _POSIX_VDISABLE
> > - return _POSIX_VDISABLE;
> > -#else
> > - return -1;
> > +#if _POSIX_VDISABLE == -1
> > +# error "Invalid value for _POSIX_VDISABLE"
> > #endif
> > + return _POSIX_VDISABLE;
>
> sysdeps/mach/hurd/bits/posix_opt.h defines _POSIX_VDISABLE
> to ((unsigned char) -1), should it be fixed, too?
Posix says that using -1 is invalid, indeed.
Samuel