Re: strerror(0) POSIX compliance

2016-03-25 Thread Christos Zoulas
In article <20160324222716.d93feb1174a7d3218aa49...@schemamania.org>, James K. Lowden wrote: >On Thu, 24 Mar 2016 17:09:50 + (UTC) >chris...@astron.com (Christos Zoulas) wrote: > >> [1] There is at least one syscall stub that clears errno before the >> syscall which I find bogus; can you guess

Re: strerror(0) POSIX compliance

2016-03-24 Thread James K. Lowden
On Thu, 24 Mar 2016 17:09:50 + (UTC) chris...@astron.com (Christos Zoulas) wrote: > >IMO it's incorrect to say 0 is an "undefined error". It's defined as > >success by nearly every syscall. The emitted string should reflect > >that, even if [sic] Posix says so. Perhaps, > > Actually not;

Re: strerror(0) POSIX compliance

2016-03-24 Thread Michael van Elst
jklow...@schemamania.org ("James K. Lowden") writes: >> Well, if calling strerror(0) is a bug, then usually because it's >> called after an error condition that didn't set errno. >Has that happened to you? I feel sure that's never happened to me, but >maybe I'm less adventurous. Happened all

Re: strerror(0) POSIX compliance

2016-03-24 Thread Joerg Sonnenberger
On Thu, Mar 24, 2016 at 05:09:50PM +, Christos Zoulas wrote: > Actually not; syscalls set errno on error, don't clear errno on success [1]. > Thus it is incorrect code to test errno if the syscall succeeded. It shows > nothing, try: Actually, it is even worse. errno is essentially *undefined*

Re: strerror(0) POSIX compliance

2016-03-24 Thread Christos Zoulas
In article <20160324125858.516aa36bc70bddd1b180e...@schemamania.org>, James K. Lowden wrote: >On Thu, 24 Mar 2016 14:29:39 + (UTC) >mlel...@serpens.de (Michael van Elst) wrote: > >> >(I agree that calling strerror(0) is odd and a likely sign of a bug, >> >but that's separate from complying wit

Re: strerror(0) POSIX compliance

2016-03-24 Thread James K. Lowden
On Thu, 24 Mar 2016 14:29:39 + (UTC) mlel...@serpens.de (Michael van Elst) wrote: > >(I agree that calling strerror(0) is odd and a likely sign of a bug, > >but that's separate from complying with standards when compliance > >isn't harmful.) > > Well, if calling strerror(0) is a bug, then usu

Re: strerror(0) POSIX compliance

2016-03-24 Thread Joerg Sonnenberger
On Thu, Mar 24, 2016 at 09:56:47AM -0400, Greg Troxel wrote: > > Joerg Sonnenberger writes: > > > On Thu, Mar 24, 2016 at 12:49:31PM +0100, Kamil Rytarowski wrote: > >> -BEGIN PGP SIGNED MESSAGE- > >> Hash: SHA256 > >> > >> POSIX extension to ISO C says: > >> > >> [CX] [Option Start] I

Re: strerror(0) POSIX compliance

2016-03-24 Thread Michael van Elst
g...@ir.bbn.com (Greg Troxel) writes: >Why do you find it questionable? If POSIX says the string must be empty >or indicate there is no error, what's wrong with following POSIX? >(I agree that calling strerror(0) is odd and a likely sign of a bug, but >that's separate from complying with standar

Re: strerror(0) POSIX compliance

2016-03-24 Thread Greg Troxel
Joerg Sonnenberger writes: > On Thu, Mar 24, 2016 at 12:49:31PM +0100, Kamil Rytarowski wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA256 >> >> POSIX extension to ISO C says: >> >> [CX] [Option Start] If the value of errnum is a valid error number, >> the message string shall indica

Re: strerror(0) POSIX compliance

2016-03-24 Thread Joerg Sonnenberger
On Thu, Mar 24, 2016 at 12:49:31PM +0100, Kamil Rytarowski wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > POSIX extension to ISO C says: > > [CX] [Option Start] If the value of errnum is a valid error number, > the message string shall indicate what error occurred; if the value of

Re: strerror(0) POSIX compliance

2016-03-24 Thread Roy Marples
On 24/03/2016 12:04, Jonathan A. Kollasch wrote: > On Thu, Mar 24, 2016 at 12:49:31PM +0100, Kamil Rytarowski wrote: >> POSIX extension to ISO C says: >> >> [CX] [Option Start] If the value of errnum is a valid error number, >> the message string shall indicate what error occurred; if the value of

Re: strerror(0) POSIX compliance

2016-03-24 Thread Jonathan A. Kollasch
> > Currently we hardcode the following text: > "Undefined error: 0", /* 0 - ENOERROR */ > > - -- src/lib/libc/compat/gen/compat_errlist.c > > gnulib check for strerror(0) POSIX compliance and it prohibits > "ndefined" string.

Re: strerror(0) POSIX compliance

2016-03-24 Thread Kamil Rytarowski
19799/functions/strerror.htm l > > Currently we hardcode the following text: "Undefined error: 0", > /* 0 - ENOERROR */ > > -- src/lib/libc/compat/gen/compat_errlist.c > > gnulib check for strerror(0) POSIX compliance and it prohibits > "ndefined" string.

strerror(0) POSIX compliance

2016-03-24 Thread Kamil Rytarowski
or: 0", /* 0 - ENOERROR */ - -- src/lib/libc/compat/gen/compat_errlist.c gnulib check for strerror(0) POSIX compliance and it prohibits "ndefined" string. http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=tests/test-str error.c#l63 Can we change this