<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 11.00.9600.19431"></HEAD>
<BODY style="WORD-WRAP: break-word; -webkit-nbsp-mode: space">
<DIV dir=ltr align=left><SPAN class=346283907-21022020><FONT color=#0000ff
size=2 face=Arial>I wasn't saying they shouldn't be in the
Standard.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=346283907-21022020><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=346283907-21022020><FONT color=#0000ff
size=2 face=Arial>Mike</FONT></SPAN></DIV><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px"
dir=ltr>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> Jim Thomas
[mailto:jaswthomas@sbcglobal.net] <BR><B>Sent:</B> 20 February 2020
23:28<BR><B>To:</B> Mike Cowlishaw<BR><B>Cc:</B> Rajan Bhakta;
CFP<BR><B>Subject:</B> Re: [Cfp-interest 1509] Question about strfromd in
glibc<BR></FONT><BR></DIV>
<DIV></DIV>The reason we have the strfrom functions is to support 754’s
convertToDecimalCharacter and convertToHexCharacter operations. The
alternative of just saying snprintf supports them has these drawbacks:
<DIV><BR></DIV>
<DIV>(1) snprintf is from <stdio.h> which need not be supported by
freestanding implementations. Freestanding implementations (that define
__STDC_IEC_60559_BFP__ or __STDC_IEC_60559_DFP__) do need to support the
numeric conversion functions in <stdlib.h> which include the strfrom
functions.</DIV>
<DIV><BR></DIV>
<DIV>(2) We’d need to invent length modifiers for the interchange and extended
types.</DIV>
<DIV><BR></DIV>
<DIV>(3) We’d have to figure out how to support the convertTo*Character
operations for non-arithmetic formats (which don’t have associated
types), either by further extending snprintf or by some other mechanism.</DIV>
<DIV><BR></DIV>
<DIV>(4) snprintf has a much more complicated (Swiss Army Knife) interface
than 754’s description of the convertTo*Character operations would
suggest.</DIV>
<DIV><BR></DIV>
<DIV>- JIm Thomas<BR>
<DIV>
<DIV><BR>
<BLOCKQUOTE type="cite">
<DIV>On Feb 20, 2020, at 5:29 AM, Mike Cowlishaw <<A
href="mailto:mfc@speleotrove.com">mfc@speleotrove.com</A>>
wrote:</DIV><BR class=Apple-interchange-newline>
<DIV>
<META name=GENERATOR content="MSHTML 11.00.9600.19431">
<DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=940382713-20022020>Good to know! I think I'll just
stick to snprintf,all the same. :-)</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=940382713-20022020></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=940382713-20022020>Mike</SPAN></FONT></DIV><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px"
type="cite">
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> <A
href="mailto:cfp-interest-bounces@oakapple.net">cfp-interest-bounces@oakapple.net</A>
[<A
href="mailto:cfp-interest-bounces@oakapple.net">mailto:cfp-interest-bounces@oakapple.net</A>]
<B>On Behalf Of </B>Rajan Bhakta<BR><B>Sent:</B> 20 February 2020
02:05<BR><B>To:</B> CFP<BR><B>Subject:</B> [Cfp-interest 1507] Fw: Re:
Question about strfromd in glibc<BR></FONT><BR></DIV>
<DIV></DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: sans-serif">So it
seems glibc does do the right thing (null terminate) and the web page was
wrong.</SPAN><BR><BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: sans-serif">Regards,<BR><BR>Rajan
Bhakta<BR>z/OS XL C/C++ Compiler Technical Architect<BR>ISO C Standards
Representative for Canada, PL22.11 Chair (USA)<BR>C Compiler
Development<BR>Contact: <A
href="mailto:rbhakta@us.ibm.com">rbhakta@us.ibm.com</A>, Rajan
Bhakta/Houston/IBM</SPAN><BR><SPAN
style="FONT-SIZE: 9pt; FONT-FAMILY: sans-serif; COLOR: #800080">-----
Forwarded by Rajan Bhakta/Houston/IBM on 02/19/2020 08:04 PM
-----</SPAN><BR><BR><SPAN
style="FONT-SIZE: 9pt; FONT-FAMILY: sans-serif; COLOR: #5f5f5f">From:
</SPAN><SPAN
style="FONT-SIZE: 9pt; FONT-FAMILY: sans-serif">Joseph Myers <<A
href="mailto:joseph@codesourcery.com">joseph@codesourcery.com</A>></SPAN><BR><SPAN
style="FONT-SIZE: 9pt; FONT-FAMILY: sans-serif; COLOR: #5f5f5f">To:
</SPAN><SPAN
style="FONT-SIZE: 9pt; FONT-FAMILY: sans-serif">Rajan Bhakta <<A
href="mailto:rbhakta@us.ibm.com">rbhakta@us.ibm.com</A>></SPAN><BR><SPAN
style="FONT-SIZE: 9pt; FONT-FAMILY: sans-serif; COLOR: #5f5f5f">Date:
</SPAN><SPAN
style="FONT-SIZE: 9pt; FONT-FAMILY: sans-serif">02/19/2020 04:20
PM</SPAN><BR><SPAN
style="FONT-SIZE: 9pt; FONT-FAMILY: sans-serif; COLOR: #5f5f5f">Subject:
</SPAN><SPAN
style="FONT-SIZE: 9pt; FONT-FAMILY: sans-serif">[EXTERNAL] Re: Question
about strfromd in glibc</SPAN><BR>
<HR noShade>
<BR><BR><BR><TT><SPAN style="FONT-SIZE: 10pt">On Wed, 19 Feb 2020, Rajan
Bhakta wrote:<BR><BR>> Hi Joseph,<BR>> <BR>> Looking at
</SPAN></TT><A
href="http://man7.org/linux/man-pages/man3/strfromd.3.html"><TT><SPAN
style="FONT-SIZE: 10pt">http://man7.org/linux/man-pages/man3/strfromd.3.html</SPAN></TT></A><TT><SPAN
style="FONT-SIZE: 10pt">, it seems <BR>> to say you could end up with
strings that are not null terminated. But <BR>> from the C standard
draft (N2454 for example) it says that the strings are <BR>> always
null terminated and only that you may get incomplete (truncation <BR>>
from the right) if 'n' is too small (yet still null terminated). Was this
<BR>> an intentional decision or am I understanding the documentation
wrong?<BR><BR>The strfrom functions are equivalent to particular calls to
snprintf, so <BR>they should always null-terminate their output (when a
nonzero size is <BR>specified). The manpages are not official glibc
documentation.<BR><BR>-- <BR>Joseph S. Myers<BR><A
href="mailto:joseph@codesourcery.com">joseph@codesourcery.com</A><BR><BR></SPAN></TT><BR><BR></BLOCKQUOTE></DIV>_______________________________________________<BR>Cfp-interest
mailing list<BR><A
href="mailto:Cfp-interest@oakapple.net">Cfp-interest@oakapple.net</A><BR>http://mailman.oakapple.net/mailman/listinfo/cfp-interest<BR></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></BLOCKQUOTE></BODY></HTML>