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

Mike Cowlishaw mfc at speleotrove.com
Wed Feb 19 09:47:56 PST 2020


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] 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 <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 <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



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
Cfp-interest at oakapple.net
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/3986edc2/attachment-0001.html 


More information about the Cfp-interest mailing list