[Cfp-interest 1500] Re: AI item to submit proposal about why no wide string strfrom functions

Mike Cowlishaw mfc at speleotrove.com
Wed Feb 19 11:11:38 PST 2020


Touché :-).
 
So therefore, perhaps, it would be better to say 'we don't have wide
strfromd functions' because they are neither widely used nor implemented
consistently (I'd never heard of them before this discussion) and it is
clearer and more likely to be understood if the programmer simply uses
strnprintf ...?
 
Mike
 


  _____  

From: Rajan Bhakta [mailto:rbhakta at us.ibm.com] 
Sent: 19 February 2020 18:16
To: Mike Cowlishaw
Cc: 'CFP'
Subject: Re: [Cfp-interest 1496] Re: AI item to submit proposal about why no
wide string strfrom functions


Hi Mike,

I think the point of the example was explicitly to say why we don't have
wide strfromd functions, so it really makes sense to keep strfromd there.

Regards,

Rajan Bhakta
z/OS XL C/C++ Compiler Technical Architect
ISO C Standards Representative for Canada, PL22.11 Chair (USA)
C Compiler Development
Contact: rbhakta at us.ibm.com, Rajan Bhakta/Houston/IBM



From:        "Mike Cowlishaw" <mfc at speleotrove.com>
To:        "'CFP'" <cfp-interest at ucbtest.org>
Date:        02/19/2020 11:49 AM
Subject:        [EXTERNAL] [Cfp-interest 1496] Re: AI item to submit
proposal about why no        wide string strfrom functions
Sent by:        cfp-interest-bounces at oakapple.net

  _____  




Hmm, given the uncertainty about 
int nc = strfromd(s, n, “%g”, d);
... perhaps just change that line to use snprintf, which has 'well-known'
behaviour?
Mike
 


  _____  

From: cfp-interest-bounces at oakapple.net [
<mailto:cfp-interest-bounces at oakapple.net>
mailto:cfp-interest-bounces at oakapple.net] On Behalf Of Jim Thomas
Sent: 05 February 2020 20:11
To: Damian McGuckin
Cc: CFP
Subject: [Cfp-interest 1468] Re: AI item to submit proposal about why no
wide string strfrom functions

Here’s an update for the code segment: 

#include <stdlib.h>
const size_t n = 20;
double d;


// convert d to single-byte character string s
char s[n];
int nc = strfromd(s, n, “%g”, d);
// convert s (regarded as a multi-byte character 
// string) to wide string ws
wchar_t ws[n];
(void)mbstowcs(ws, s, n);

On Feb 5, 2020, at 9:55 AM, Jim Thomas < <mailto:jaswthomas at sbcglobal.net>
jaswthomas at sbcglobal.net> wrote:

Probably so. the other code examples in the C standard include all the
declarations. Update to follow.

- Jim

On Feb 4, 2020, at 4:04 PM, Damian McGuckin < <mailto:damianm at esi.com.au>
damianm at esi.com.au> wrote:

On Tue, 4 Feb 2020, Jim Thomas wrote:

Action item:
       Jim: Get a WG14 document number and submit
   C2x_proposal_-_why_no_wide_string_strfrom_functions-
   20191230.pdf.
The following was submitted to WG14:
 <http://wiki.edg.com/pub/CFP/WebHome/n2475.pdf>
http://wiki.edg.com/pub/CFP/WebHome/n2475.pdf

Do you need a declaration for the wide string 'ws' in that code at the end?

Regards - Damian

Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037
Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here
Views & opinions here are mine and not those of any past or present employer


_______________________________________________
Cfp-interest mailing list
 <mailto:Cfp-interest at oakapple.net> Cfp-interest at oakapple.net
 <http://mailman.oakapple.net/mailman/listinfo/cfp-interest>
http://mailman.oakapple.net/mailman/listinfo/cfp-interest
_______________________________________________
Cfp-interest mailing list
Cfp-interest at oakapple.net
 <http://mailman.oakapple.net/mailman/listinfo/cfp-interest>
http://mailman.oakapple.net/mailman/listinfo/cfp-interest





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20200219/dbcdcbf8/attachment-0001.html 


More information about the Cfp-interest mailing list