public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix vswprintf
@ 2006-01-10 16:04 Jakub Jelinek
  2006-01-10 18:27 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2006-01-10 16:04 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

#define _GNU_SOURCE
#include <wchar.h>
#include <stdio.h>
#include <stdarg.h>

void foo (wchar_t *p, va_list ap)
{
  vswprintf (p, 16, L"abc%p", ap);
}

doesn't compile with:
gcc -S -O2 a.c -D_FORTIFY_SOURCE=1
/usr/include/bits/wchar2.h: In function 'foo':
/usr/include/bits/wchar2.h:223: sorry, unimplemented: inlining failed in call to 'vswprintf': recursive inlining
/usr/include/bits/wchar2.h:227: sorry, unimplemented: called from here

Fixed thusly:  

2006-01-10  Jakub Jelinek  <jakub@redhat.com>

	* wcsmbs/bits/wchar2.h (vswprintf): Call __vswprintf_alias rather than
	vswprintf recursively.

--- libc/wcsmbs/bits/wchar2.h.jj	2005-09-12 09:21:43.000000000 +0200
+++ libc/wcsmbs/bits/wchar2.h	2006-01-10 16:59:02.000000000 +0100
@@ -1,5 +1,5 @@
 /* Checking macros for wchar functions.
-   Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -224,7 +224,7 @@ __NTH (vswprintf (wchar_t *__s, size_t _
   if (__bos (__s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1)
     return __vswprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, __bos (__s),
 			    __format, __arg);
-  return vswprintf (__s, __n, __format, __arg);
+  return __vswprintf_alias (__s, __n, __format, __arg);
 }
 
 

	Jakub

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

* Re: [PATCH] Fix vswprintf
  2006-01-10 16:04 [PATCH] Fix vswprintf Jakub Jelinek
@ 2006-01-10 18:27 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2006-01-10 18:27 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Glibc hackers

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

Applied.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

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

end of thread, other threads:[~2006-01-10 18:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-10 16:04 [PATCH] Fix vswprintf Jakub Jelinek
2006-01-10 18:27 ` Ulrich Drepper

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