public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] stdio: Move include of bits/stdio-ldbl.h before bits/stdio.h
@ 2021-03-22 11:15 John Paul Adrian Glaubitz
  2021-03-23 17:59 ` Adhemerval Zanella
  0 siblings, 1 reply; 8+ messages in thread
From: John Paul Adrian Glaubitz @ 2021-03-22 11:15 UTC (permalink / raw)
  To: libc-alpha; +Cc: adhemerval.zanella, John Paul Adrian Glaubitz

On targets where long double math is optional and the architecture
does not support support long double, glibc defines a number of
redirection macros which alias "foo" with "__nldbl_foo" while
applying an __asm__ label.

As a result, the __asm__ label gets applied after vfprintf() has
already been used which is not allowed. Moving bits/stdio-ldbl.h
bits/stdio.h in libio/stdio.h avoids this problem.

Fixes bug 27558.
---
 libio/stdio.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libio/stdio.h b/libio/stdio.h
index 144137cf67..ae5337e855 100644
--- a/libio/stdio.h
+++ b/libio/stdio.h
@@ -857,6 +857,11 @@ extern void funlockfile (FILE *__stream) __THROW;
 extern int __uflow (FILE *);
 extern int __overflow (FILE *, int);
 
+#include <bits/floatn.h>
+#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
+# include <bits/stdio-ldbl.h>
+#endif
+
 /* If we are compiling with optimizing read this file.  It contains
    several optimizing inline functions and macros.  */
 #ifdef __USE_EXTERN_INLINES
@@ -866,11 +871,6 @@ extern int __overflow (FILE *, int);
 # include <bits/stdio2.h>
 #endif
 
-#include <bits/floatn.h>
-#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
-# include <bits/stdio-ldbl.h>
-#endif
-
 __END_DECLS
 
 #endif /* <stdio.h> included.  */
-- 
2.31.0


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

end of thread, other threads:[~2022-03-08 10:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 11:15 [PATCH] stdio: Move include of bits/stdio-ldbl.h before bits/stdio.h John Paul Adrian Glaubitz
2021-03-23 17:59 ` Adhemerval Zanella
2021-08-16 12:24   ` John Paul Adrian Glaubitz
2022-01-22 10:39   ` John Paul Adrian Glaubitz
2022-02-23 20:51   ` John Paul Adrian Glaubitz
2022-02-24 17:10     ` Adhemerval Zanella
2022-03-03 19:25       ` Adhemerval Zanella
2022-03-08 10:34         ` John Paul Adrian Glaubitz

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).