Re: new module suggestion: fprintftime-check

2019-01-05 Thread Florian Weimer
* Bruno Haible: > Florian Weimer wrote: >> The standards do not provide a way to report errors for malformed format >> strings. I think the current behavior is acceptable, all things >> considered. > > OK, then I'm fine with Assaf's approach to create a new, separate function > that does only the

Re: new module suggestion: fprintftime-check

2019-01-05 Thread Bruno Haible
Florian Weimer wrote: > The standards do not provide a way to report errors for malformed format > strings. I think the current behavior is acceptable, all things > considered. OK, then I'm fine with Assaf's approach to create a new, separate function that does only the syntax checking. Bruno

Re: new module suggestion: fprintftime-check

2019-01-02 Thread Florian Weimer
* Bruno Haible: > [CCing Florian Weimer. > Florian, the thread started at > https://lists.gnu.org/archive/html/bug-gnulib/2018-12/msg00149.html ] > > Assaf Gordon wrote: >> The comment even says: >>/* Unknown format; output the format, including the '%', >> since this is most lik

Re: new module suggestion: fprintftime-check

2018-12-30 Thread Paul Eggert
Ben Pfaff wrote: On Sat, Dec 29, 2018 at 09:22:17AM -0800, Paul Eggert wrote: (Using ptrdiff_t is part of my campaign to prefer ptrdiff_t to size_t. While we're at it, let's change the other size_t args to ptrdiff_t, but I digress) Have you said anything about this campaign elsewhere? I'd

Re: new module suggestion: fprintftime-check

2018-12-29 Thread Ben Pfaff
On Sat, Dec 29, 2018 at 09:22:17AM -0800, Paul Eggert wrote: > (Using ptrdiff_t is part of my campaign to prefer ptrdiff_t to size_t. While > we're at it, let's change the other size_t args to ptrdiff_t, but I > digress) Have you said anything about this campaign elsewhere? I'd like to hear m

Re: new module suggestion: fprintftime-check

2018-12-29 Thread Paul Eggert
I suspect that changing this behavior would be a disruptive backwards-incompatible change (but other opinions are welcomed). I wouldn't mind a change as long as it changes the API enough so that compilers complain if we don't also update the calling code. For example, nstrftime could take an a

Re: new module suggestion: fprintftime-check

2018-12-29 Thread Assaf Gordon
On 2018-12-28 11:08 p.m., Bruno Haible wrote: [CCing Florian Weimer. Florian, the thread started at https://lists.gnu.org/archive/html/bug-gnulib/2018-12/msg00149.html ] Assaf Gordon wrote: The comment even says: /* Unknown format; output the format, including the '%', since

Re: new module suggestion: fprintftime-check

2018-12-28 Thread Bruno Haible
[CCing Florian Weimer. Florian, the thread started at https://lists.gnu.org/archive/html/bug-gnulib/2018-12/msg00149.html ] Assaf Gordon wrote: > The comment even says: >/* Unknown format; output the format, including the '%', > since this is most likely the right thing to do if

Re: new module suggestion: fprintftime-check

2018-12-28 Thread Assaf Gordon
Hello Bruno, On 2018-12-28 9:34 a.m., Bruno Haible wrote: This function enables syntax-check of the format string. First question: Should this syntax-check be integrated into the nstrftime() and fprintftime() functions? These functions are gnulib inventions, therefore they could be extended to

Re: new module suggestion: fprintftime-check

2018-12-28 Thread Bruno Haible
Hi Assaf, > This function enables syntax-check of the format string. First question: Should this syntax-check be integrated into the nstrftime() and fprintftime() functions? These functions are gnulib inventions, therefore they could be extended to return - an error indicator (maybe EINVAL?),

new module suggestion: fprintftime-check

2018-12-28 Thread Assaf Gordon
Hello, I'd like to suggest the following new module: fprintftime-check. It uses the same infrastructure as fprintftime (i.e. #include "nstrtime,c") to implement a new function: int fprintftime_check (const char *format, const char** err_ptr); This function enables syntax-check of the format s