public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] Fix vswprintf
Date: Tue, 10 Jan 2006 16:04:00 -0000	[thread overview]
Message-ID: <20060110160413.GA4625@sunsite.mff.cuni.cz> (raw)

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

             reply	other threads:[~2006-01-10 16:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-10 16:04 Jakub Jelinek [this message]
2006-01-10 18:27 ` Ulrich Drepper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060110160413.GA4625@sunsite.mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=drepper@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).