From owner-freebsd-standards@FreeBSD.ORG Sun Jan 24 05:13:24 2010 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 100A11065672 for ; Sun, 24 Jan 2010 05:13:24 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-pz0-f202.google.com (mail-pz0-f202.google.com [209.85.222.202]) by mx1.freebsd.org (Postfix) with ESMTP id E99A08FC08 for ; Sun, 24 Jan 2010 05:13:23 +0000 (UTC) Received: by pzk40 with SMTP id 40so148260pzk.7 for ; Sat, 23 Jan 2010 21:13:23 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.143.24.32 with SMTP id b32mr3393456wfj.315.1264308654298; Sat, 23 Jan 2010 20:50:54 -0800 (PST) From: Juli Mallett Date: Sat, 23 Jan 2010 20:50:34 -0800 X-Google-Sender-Auth: 0b745736e100f6c3 Message-ID: To: freebsd-standards@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: wchar_t in inttypes.h and C++ X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2010 05:13:24 -0000 Hey folks, The handling of wchar_t in inttypes.h for wcsto*max(3) is currently broken in C++ where wchar_t is a built-in type and not derived from __wchar_t. I have a patch to define wchar_t if it isn't defined in C and to use wchar_t in the declarations rather than __wchar_t as we do today, as is done in other headers that declare wchar_t functions. BDE doesn't like it -- certainly it's unclear that it would be okay for inttypes.h to define wchar_t in C -- but I'm not sure there's a markedly-better alternative. We could define a type ___wchar_t (or something like) that is a typedef of __wchar_t in C and a typedef of wchar_t in C++. We could define wcsto*max(3) differently for C++ and C. We could declare the functions as taking wchar_t but only define them if wchar_t has been defined (or we're compiling for C++). For the sake of argument, here's the inttypes.h patch that follows the lead of stdlib.h: http://people.freebsd.org/~jmallett/wchar-inttypes.diff Thanks, Juli.