All of lore.kernel.org
 help / color / mirror / Atom feed
* strfromd.3: restrict? C99?
@ 2021-03-10 17:32 Alejandro Colomar (man-pages)
  2021-03-10 21:59 ` Joseph Myers
  0 siblings, 1 reply; 2+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-03-10 17:32 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages), Wainer dos Santos Moschetta
  Cc: linux-man, libc-alpha

Hello Michael, Wainer,

It's weird.  The only manual page that I've seen using restrict, and I 
think it's wrong.  glibc doesn't use it:

.../glibc$ grep_glibc_prototype strfromd
src/gnu/glibc/stdlib/stdlib.h:212:
extern int strfromd (char *__dest, size_t __size, const char *__format,
		     double __f)
      __THROW __nonnull ((3));
.../glibc$ grep_glibc_prototype strfromf
src/gnu/glibc/stdlib/stdlib.h:216:
extern int strfromf (char *__dest, size_t __size, const char *__format,
		     float __f)
      __THROW __nonnull ((3));
.../glibc$ grep_glibc_prototype strfroml
src/gnu/glibc/stdlib/stdlib.h:220:
extern int strfroml (char *__dest, size_t __size, const char *__format,
		     long double __f)
      __THROW __nonnull ((3));
.../glibc$

And the manual page states that it conforms to some standards, but I 
haven't found it in C99 (neither in C11 nor C18) nor in POSIX:

$ man 3 strfromd | sed -n '/CONFORMING/,/^$/p'
CONFORMING TO
        C99, ISO/IEC TS 18661-1.

$ man 3p strfromd
No manual entry for strfromd in section 3p
$

I don't know what that other "ISO/IEC TS 18661-1" is.

<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf>
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf>
<https://web.archive.org/web/20181230041359if_/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf>


Should I remove restrict?  And C99 from the CONFORMING TO section?

Thanks,

Alex


-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: strfromd.3: restrict? C99?
  2021-03-10 17:32 strfromd.3: restrict? C99? Alejandro Colomar (man-pages)
@ 2021-03-10 21:59 ` Joseph Myers
  0 siblings, 0 replies; 2+ messages in thread
From: Joseph Myers @ 2021-03-10 21:59 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages)
  Cc: Michael Kerrisk (man-pages),
	Wainer dos Santos Moschetta, linux-man, libc-alpha

On Wed, 10 Mar 2021, Alejandro Colomar (man-pages) via Libc-alpha wrote:

> And the manual page states that it conforms to some standards, but I haven't
> found it in C99 (neither in C11 nor C18) nor in POSIX:

The strfrom functions are in TS 18661-1, and draft C23 which integrated 
all of TS 18661-1 and -2 and parts of -4 (-3 will be added in an Annex).  
They use restrict in both places.  So it would be appropriate to use 
__restrict in the glibc header (as documentation, qualifiers on function 
parameter types in a declaration that isn't a definition don't have any 
semantic effect).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-10 22:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 17:32 strfromd.3: restrict? C99? Alejandro Colomar (man-pages)
2021-03-10 21:59 ` Joseph Myers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.