public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] mention disabling GCC built-ins for customization
@ 2018-06-13 18:19 Martin Sebor
  2018-06-13 20:35 ` Florian Weimer
  2018-06-14  7:25 ` Andreas Schwab
  0 siblings, 2 replies; 11+ messages in thread
From: Martin Sebor @ 2018-06-13 18:19 UTC (permalink / raw)
  To: GNU C Library

[-- Attachment #1: Type: text/plain, Size: 513 bytes --]

The GCC sprintf optimization introduced in GCC 7 relies on
the conformance of the library implementation of formatted
I/O functions.  When a sprintf customization changes
the effects of the function in a way that's observable by
a strictly conforming program it might interfere with
the optimization.

Since this may not be obvious to users the attached patch
adds a couple of sentences to the manual to make it clear
that the sprintf built-in handling needs to be disabled
when customizing the function.

Martin

[-- Attachment #2: glibc-doc-customizing-printf.diff --]
[-- Type: text/x-patch, Size: 874 bytes --]

ChangeLog:
	* manual/stdio.texi (Customizing printf): Add a note to disable
	built-in handling.

diff --git a/manual/stdio.texi b/manual/stdio.texi
index 38be236..d945955 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.
 
 @node Registering New Conversions
 @subsection Registering New Conversions

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-06-29 17:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-13 18:19 [PATCH] mention disabling GCC built-ins for customization Martin Sebor
2018-06-13 20:35 ` Florian Weimer
2018-06-13 20:55   ` Martin Sebor
2018-06-13 21:01     ` Florian Weimer
2018-06-13 21:31       ` Martin Sebor
2018-06-14  7:25 ` Andreas Schwab
2018-06-14 19:11   ` Martin Sebor
2018-06-18  7:42     ` Andreas Schwab
2018-06-19  3:00       ` Martin Sebor
2018-06-27 23:37     ` PING " Martin Sebor
2018-06-29 17:01       ` Martin Sebor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).