printf official specs or docs, ISO C99, and C++

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

printf official specs or docs, ISO C99, and C++

Boost - Dev mailing list
I found https://svn.boost.org/trac10/ticket/10541 today and my guess is
Boost.Format hasn't been updated to support the ISO C99 extensions, or the
Microsoft type formats.  Before any work is done on this, I'm looking for
any official C++ documentation related to printf support requirements.  For
example the compatibility section in
http://www.cplusplus.com/reference/cstdio/printf/ indicates certain
language levels have requirements.

Thanks,

Jim

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: printf official specs or docs, ISO C99, and C++

Boost - Dev mailing list
On 10/12/17 21:26, James E. King, III via Boost wrote:
> I found https://svn.boost.org/trac10/ticket/10541 today and my guess is
> Boost.Format hasn't been updated to support the ISO C99 extensions, or the
> Microsoft type formats.  Before any work is done on this, I'm looking for
> any official C++ documentation related to printf support requirements.  For
> example the compatibility section in
> http://www.cplusplus.com/reference/cstdio/printf/ indicates certain
> language levels have requirements.

The C++ standard simply refers to the C standard (see [cstdio.syn]), so
you should look there for the primary specification. I think there are
also a few POSIX extensions, which are widely supported and probably
worth supporting as well. Microsoft extensions like those mentioned in
the ticket are probably less useful because they are not present outside
MSVC. Supporting those extentions encourages non-portable code.

Regardless of the set of features you choose to support, IMO it should
be the same regardless of the compiler/platform/C++ version being targeted.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: printf official specs or docs, ISO C99, and C++

Boost - Dev mailing list
On Thu, Oct 12, 2017 at 5:23 PM, Andrey Semashev via Boost <
[hidden email]> wrote:

> On 10/12/17 21:26, James E. King, III via Boost wrote:
>
>> I found https://svn.boost.org/trac10/ticket/10541 today and my guess is
>> Boost.Format hasn't been updated to support the ISO C99 extensions, or the
>> Microsoft type formats.  Before any work is done on this, I'm looking for
>> any official C++ documentation related to printf support requirements.
>> For
>> example the compatibility section in
>> http://www.cplusplus.com/reference/cstdio/printf/ indicates certain
>> language levels have requirements.
>>
>
> The C++ standard simply refers to the C standard (see [cstdio.syn]), so
> you should look there for the primary specification. I think there are also
> a few POSIX extensions, which are widely supported and probably worth
> supporting as well. Microsoft extensions like those mentioned in the ticket
> are probably less useful because they are not present outside MSVC.
> Supporting those extentions encourages non-portable code.
>
> Regardless of the set of features you choose to support, IMO it should be
> the same regardless of the compiler/platform/C++ version being targeted.
>

Perhaps a good place to start looking for discrepancies would be the ISO
C11 specification then?
http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1570.pdf
Specifically sections 7.8.1 and 7.21.6 and 7.29.2.

- Jim

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: printf official specs or docs, ISO C99, and C++

Boost - Dev mailing list
On Thu, Oct 12, 2017 at 6:39 PM, James E. King, III via Boost <
[hidden email]> wrote:

>
> Perhaps a good place to start looking for discrepancies would be the ISO
> C11 specification then?
> http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1570.pdf
> Specifically sections 7.8.1 and 7.21.6 and 7.29.2.
>

If you haven't already done so, you also might want to review Victor
Zverovich's standards committee Format proposal. See http://wg21link.p0645
and also his CppCon presentation at
https://www.youtube.com/watch?v=ptba_AqFYCM

The R0 version got a very favorable reception from the LEWG this summer, so
expect an R1 revision in a week or ten days when the committee's
Albuquerque pre-meeting mailing becomes available.

--Beman

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost