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

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

[PATCH] Fix vswprintf


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


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