From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18249 invoked by alias); 11 Apr 2008 15:21:00 -0000 Received: (qmail 18128 invoked by uid 48); 11 Apr 2008 15:20:17 -0000 Date: Fri, 11 Apr 2008 15:21:00 -0000 Subject: [Bug c/35908] New: Dubious charset conversions X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "neil at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-04/txt/msg00830.txt.bz2 GCC accepts the following with -ansi -pedantic -Wall without diagnostics #include wchar_t z[] = L"a" "\xff"; GCC claims a default execution charset of UTF-8; presumably the default execution wide character set is UTF-32. But "\xff" is a two-character narrow execution character set string literal, with characters \xff \0, which is invalid UTF-8 and so cannot be converted in a meaningful way to the execution character set (whatever it is). I would expect the above code to be rejected, or at least diagnosed. -- Summary: Dubious charset conversions Product: gcc Version: 4.1.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: neil at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35908