Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Joey Schulze
Michael Kerrisk wrote: > > But I'm not sure if that's a bug or not as I don't know whether > > manpages-dev is meant to document the GNU or other version of > > the libc functions. > > I don't know that manpages-dev has a policy on that. Upstream > man-pages policy is: yes, document glibc specifi

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Stephane Chazelas
On Mon, Jun 23, 2008 at 01:52:07PM +0100, Stephane Chazelas wrote: [...] > So, %as is not available for instance with: > > cc -D__STDC_VERSION__=199901L > (tcc does set that as a builtin macro > http://hg.sharesource.org/mercurialtcc/rev/1e81d5b65878) [...] FYI, and I'm getting off-topic here, th

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Michael Kerrisk
On Mon, Jun 23, 2008 at 3:13 PM, Stephane Chazelas <[EMAIL PROTECTED]> wrote: > On Mon, Jun 23, 2008 at 01:47:59PM +0200, Michael Kerrisk wrote: >> Right, here's another version. Could you please have another read >> through, Stephane > > Michael, > > it looks good to me. > > I suspect it wasn't y

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Stephane Chazelas
On Mon, Jun 23, 2008 at 01:47:59PM +0200, Michael Kerrisk wrote: > Right, here's another version. Could you please have another read > through, Stephane Michael, it looks good to me. I suspect it wasn't your intention to leave >printf("n=%d, errno=%d\n", n, errno); in though. That p

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Stephane Chazelas
On Mon, Jun 23, 2008 at 01:45:28PM +0200, Michael Kerrisk wrote: > On Mon, Jun 23, 2008 at 1:43 PM, Stephane Chazelas > <[EMAIL PROTECTED]> wrote: > > On Mon, Jun 23, 2008 at 01:34:04PM +0200, Michael Kerrisk wrote: > >> On Mon, Jun 23, 2008 at 1:31 PM, Stephane Chazelas > >> <[EMAIL PROTECTED]> wr

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Stephane Chazelas
On Mon, Jun 23, 2008 at 01:43:39PM +0200, Michael Kerrisk wrote: [...] > > errno = 0; > > n = scanf(..., &p); > > if (n == 1) { > > printf("OK: %s\n", p); > > free(p); > > } else if (errno != 0) { > > perror("scanf"); > > } > > else { > > fprintf(stderr, "expected letters, not \"%s\"\n", ...);

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Michael Kerrisk
Right, here's another version. Could you please have another read through, Stephane NOTES The GNU C library supports a non-standard extension that causes the library to dynamically allocate a string of sufficient size for input strings for the %s and %a[range] co

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Michael Kerrisk
On Mon, Jun 23, 2008 at 1:43 PM, Stephane Chazelas <[EMAIL PROTECTED]> wrote: > On Mon, Jun 23, 2008 at 01:34:04PM +0200, Michael Kerrisk wrote: >> On Mon, Jun 23, 2008 at 1:31 PM, Stephane Chazelas >> <[EMAIL PROTECTED]> wrote: >> > On Mon, Jun 23, 2008 at 12:37:50PM +0200, Michael Kerrisk wrote:

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Michael Kerrisk
Hi Stephane, On Mon, Jun 23, 2008 at 1:15 PM, Stephane Chazelas <[EMAIL PROTECTED]> wrote: > On Mon, Jun 23, 2008 at 12:37:50PM +0200, Michael Kerrisk wrote: > [...] >>NOTES >>The GNU C library supports a non-standard extension that causes >>the library to dynamically allocate

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Stephane Chazelas
On Mon, Jun 23, 2008 at 01:34:04PM +0200, Michael Kerrisk wrote: > On Mon, Jun 23, 2008 at 1:31 PM, Stephane Chazelas > <[EMAIL PROTECTED]> wrote: > > On Mon, Jun 23, 2008 at 12:37:50PM +0200, Michael Kerrisk wrote: > > [...] > >>This feature is not available if the program is compiled wi

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Stephane Chazelas
On Mon, Jun 23, 2008 at 12:37:50PM +0200, Michael Kerrisk wrote: [...] >This feature is not available if the program is compiled with >cc -std=cc99 or cc -D_ISOC99_SOURCE (unless _GNU_SOURCE is also [...] typo: -std=c99, not cc99. -- Stéphane -- To UNSUBSCRIBE, email to [EMA

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Michael Kerrisk
On Mon, Jun 23, 2008 at 1:31 PM, Stephane Chazelas <[EMAIL PROTECTED]> wrote: > On Mon, Jun 23, 2008 at 12:37:50PM +0200, Michael Kerrisk wrote: > [...] >>This feature is not available if the program is compiled with >>cc -std=cc99 or cc -D_ISOC99_SOURCE (unless _GNU_SOURCE is als

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Stephane Chazelas
On Mon, Jun 23, 2008 at 12:37:50PM +0200, Michael Kerrisk wrote: [...] >NOTES >The GNU C library supports a non-standard extension that causes >the library to dynamically allocate a string of sufficient size >for input strings for the %s and %a[range] conversio

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Michael Kerrisk
tags 487254 fixed-upstream thanks Stephane, both halves of this bug are now fixed. Could you please review the following new text, which will appear in man-pages 3.01. Cheers, Michael NOTES The GNU C library supports a non-standard extension that causes the library to dynamica

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Michael Kerrisk
On Mon, Jun 23, 2008 at 11:34 AM, Michael Kerrisk <[EMAIL PROTECTED]> wrote: > On Mon, Jun 23, 2008 at 11:33 AM, Stephane Chazelas > <[EMAIL PROTECTED]> wrote: >> On Mon, Jun 23, 2008 at 11:27:39AM +0200, Michael Kerrisk wrote: >> [...] >>> > Also, the %as GNU extension seems not to be documented >

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Michael Kerrisk
Stephane, > Also, the %as GNU extension seems not to be documented > (it may return ENOMEM) in the man page. It is in the glibc > documentation. Have you tried using this? I'm trying to test now, but gcc complains that '%a' expects type 'float *'. Cheers, Michael -- Michael Kerrisk Linux man-

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Stephane Chazelas
On Mon, Jun 23, 2008 at 11:27:39AM +0200, Michael Kerrisk wrote: [...] > > Also, the %as GNU extension seems not to be documented > > (it may return ENOMEM) in the man page. It is in the glibc > > documentation. > > Have you tried using this? I'm trying to test now, but gcc complains > that '%a'

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Michael Kerrisk
On Mon, Jun 23, 2008 at 11:33 AM, Stephane Chazelas <[EMAIL PROTECTED]> wrote: > On Mon, Jun 23, 2008 at 11:27:39AM +0200, Michael Kerrisk wrote: > [...] >> > Also, the %as GNU extension seems not to be documented >> > (it may return ENOMEM) in the man page. It is in the glibc >> > documentation. >

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Stephane Chazelas
On Mon, Jun 23, 2008 at 11:08:45AM +0200, Michael Kerrisk wrote: [...] > I don't know that manpages-dev has a policy on that. Upstream > man-pages policy is: yes, document glibc specifics (but give context > re portability). [...] Thanks a lot Michael for all the details. BTW, I just came accros

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Stephane Chazelas
On Mon, Jun 23, 2008 at 10:34:14AM +0200, Michael Kerrisk wrote: [...] > Okay -- I verified this. > > One of the problems here of course is that the scanf.3 page currently > doesn't document *any* errors... > > > and possibly to EINVAL for a > > figures not in the requested base. > > Can you pro

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Michael Kerrisk
Hi Stephane, There are at least two logically separate bug reports here. In such cases, *please* file separate reports. See below for why. On Fri, Jun 20, 2008 at 5:35 PM, Stephane Chazelas <[EMAIL PROTECTED]> wrote: > Package: manpages-dev > Version: 2.80-1 > Severity: normal > > > In the GNU

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Michael Kerrisk
Hi Stephane, On Mon, Jun 23, 2008 at 10:51 AM, Stephane Chazelas <[EMAIL PROTECTED]> wrote: > On Mon, Jun 23, 2008 at 10:34:14AM +0200, Michael Kerrisk wrote: > [...] >> Okay -- I verified this. >> >> One of the problems here of course is that the scanf.3 page currently >> doesn't document *any* e

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-23 Thread Michael Kerrisk
>> In the GNU and UC versions of the libc (at least), the >> scanf/fscanf/sscanf... functions seem to be calling strtoxxx >> internally for number conversions. >> >> In doing so, errno may be set to ERANGE when the input doesn't >> fit in the number size requested > > Okay -- I verified this. > > O

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-21 Thread Michael Kerrisk
On Fri, Jun 20, 2008 at 5:58 PM, Stephane Chazelas <[EMAIL PROTECTED]> wrote: > On Fri, Jun 20, 2008 at 04:35:27PM +0100, Stephane Chazelas wrote: > [...] >> In the GNU and UC versions of the libc (at least), the >> scanf/fscanf/sscanf... functions seem to be calling strtoxxx >> internally for numb

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-20 Thread Stephane Chazelas
On Fri, Jun 20, 2008 at 04:35:27PM +0100, Stephane Chazelas wrote: [...] > In the GNU and UC versions of the libc (at least), the > scanf/fscanf/sscanf... functions seem to be calling strtoxxx > internally for number conversions. > > In doing so, errno may be set to ERANGE when the input doesn't >

Bug#487254: manpages-dev: *scanf may set errno to ERANGE

2008-06-20 Thread Stephane Chazelas
Package: manpages-dev Version: 2.80-1 Severity: normal In the GNU and UC versions of the libc (at least), the scanf/fscanf/sscanf... functions seem to be calling strtoxxx internally for number conversions. In doing so, errno may be set to ERANGE when the input doesn't fit in the number size requ