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

Rajan Bhakta rbhakta at us.ibm.com
Wed Feb 19 12:02:53 PST 2020


Hi Mike,

I would probably not go that route since we proposed adding this example 
in the first place to WG14 (i.e. No one asked us to do so, we brought it 
up due to a CFP discussion). If, after asking WG14 to bless us adding 
this, we then say there is no point, I'd wonder why we asked in the first 
place.

With regards to your specific point about wide string functions not being 
widely used, I agree they are not widely used, but they are used and there 
have been requests by two separate WG14 members to add in versions of wide 
string functions to other (unrelated to floating point) proposals so I 
think it is good we do mention them.

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:     "'Rajan Bhakta'" <rbhakta at us.ibm.com>
Cc:     "'CFP'" <cfp-interest at ucbtest.org>
Date:   02/19/2020 01:11 PM
Subject:        [EXTERNAL] RE: [Cfp-interest 1496] Re: AI item to submit 
proposal about why no   wide string strfrom functions



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] 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
_______________________________________________
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/c4b4263a/attachment.html 


More information about the Cfp-interest mailing list