This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v5 1/3] Add strfromd, strfromf, and strfroml functions
On Wed, 5 Oct 2016, Rical Jasan wrote:
> Actually, what I'm really wondering at this point is whether ignoring
> invalid format specifiers is good form, instead of indicating some kind
> of error (perhaps that's in the spec). If we're going to skip_format
> for specifiers that are set but don't begin with '%' and set precision=0
> and specifier='f' for those that do but may be improperly formatted in
> other ways, I think we should say so in the documentation. A simple
> addendum to the format specifier paragraph should suffice: "Invalid
> format specifiers are silently ignored."
We should certainly not document any semantics like that for such
undefined behavior. See
<https://sourceware.org/glibc/wiki/Style_and_Conventions#Error_Handling>:
"If it's user code invoking undefined behavior, then it should fail early
and catastrophically". So if there are any checks for cases that TS
18661-1 says involve undefined behavior, then calling abort () is better
than picking some other default.
--
Joseph S. Myers
joseph@codesourcery.com