This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] mention disabling GCC built-ins for customization


On 06/18/2018 01:41 AM, Andreas Schwab wrote:
On Jun 14 2018, Martin Sebor <msebor@gmail.com> wrote:

diff --git a/manual/stdio.texi b/manual/stdio.texi
index 38be236..26a570f 100644
--- a/manual/stdio.texi
+++ b/manual/stdio.texi
@@ -2963,7 +2963,11 @@ The facilities of this section are declared in the header file

 @strong{Portability Note:} The ability to extend the syntax of
 @code{printf} template strings is a GNU extension.  ISO standard C has
-nothing similar.
+nothing similar.  When using the GNU C compiler or any other compiler
+that interprets calls to standard I/O functions according to the rules
+of the language standard it is necessary to disable such handling by
+the appropriate compiler option.  Otherwise the behavior of a program
+that relies on the extension is undefined.

Is that really needed?  Didn't you say that GCC disables its
optimisations when an unknown format is encountered?

Saying the behavior is undefined is the conservative thing to do.
I would not be comfortable providing a stronger guarantee for GCC
but if it were thought necessary to say more, the place to go into
the details would the GCC manual where they could be kept in sync
with the implementation.  IMO, the Glibc manual (and the manual
of any other I/O library) should defer to the compiler manual,
and that's what this text does.

Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]