From owner-freebsd-standards Mon Jul 1 11:10: 5 2002 Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DFF9A37B400 for ; Mon, 1 Jul 2002 11:10:02 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4CDDD43E13 for ; Mon, 1 Jul 2002 11:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g61IA2JU098173 for ; Mon, 1 Jul 2002 11:10:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g61IA2YY098172; Mon, 1 Jul 2002 11:10:02 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8C70037B401; Mon, 1 Jul 2002 11:00:11 -0700 (PDT) Received: from fafoe.dyndns.org (chello212186121237.14.vie.surfer.at [212.186.121.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0994443E0A; Mon, 1 Jul 2002 11:00:11 -0700 (PDT) (envelope-from stefan@fafoe.dyndns.org) Received: by frog.fafoe (Postfix, from userid 1001) id BD0F1263; Mon, 1 Jul 2002 18:49:10 +0200 (CEST) Message-Id: <20020701164910.BD0F1263@frog.fafoe> Date: Mon, 1 Jul 2002 18:49:10 +0200 (CEST) From: Stefan Farfeleder Reply-To: Stefan Farfeleder To: FreeBSD-gnats-submit@FreeBSD.org Cc: obrien@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: standards/40084: g++ complaining about redeclaration of wchar_t with -pedantic Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >Number: 40084 >Category: standards >Synopsis: g++ complaining about redeclaration of wchar_t with -pedantic >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Jul 01 11:10:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Stefan Farfeleder >Release: FreeBSD 4.6-STABLE i386 >Organization: >Environment: System: FreeBSD frog.fafoe 4.6-STABLE FreeBSD 4.6-STABLE #9: Sat Jun 29 22:00:32 CEST 2002 root@frog.fafoe:/usr/obj/usr/src/sys/FROG i386 >Description: With the update to gcc 2.95.4, code to distinguish system headers from others was disabled in is_system_include(). As a consequence, warnings (only with -pedantic) about wchar_t being redeclared (because wchar_t is builtin in C++) aren't suppressed anymore. >How-To-Repeat: %cat wchar.cc #include int main() { } %g++ -ansi -pedantic -W -Wall wchar.cc In file included from /usr/include/g++/cstddef:6, from wchar.cc:1: /usr/include/stddef.h:58: warning: redeclaration of wchar_t as `int' >Fix: One possible solution would be not to define _BSD_WCHAR_T_ in ansi.h when compiling in C++ mode: --- ansi.h.orig Mon Jul 1 18:01:39 2002 +++ ansi.h Mon Jul 1 18:03:45 2002 @@ -56,7 +56,10 @@ #define _BSD_SSIZE_T_ int /* byte count or error */ #define _BSD_TIME_T_ long /* time()... */ #define _BSD_TIMER_T_ int /* timer_gettime()... */ +/* wchar_t is builtin in C++ */ +#ifndef __cplusplus #define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */ +#endif #define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t (see below) */ /* >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message