From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32569 invoked by alias); 14 Nov 2002 22:36:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 32505 invoked by uid 71); 14 Nov 2002 22:36:03 -0000 Resent-Date: 14 Nov 2002 22:36:03 -0000 Resent-Message-ID: <20021114223603.32504.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, austern@apple.com Received: (qmail 26869 invoked by uid 61); 14 Nov 2002 22:27:05 -0000 Message-Id: <20021114222705.26867.qmail@sources.redhat.com> Date: Thu, 21 Nov 2002 04:06:00 -0000 From: austern@apple.com Reply-To: austern@apple.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/8586: Compiler should warn when converting a string literal to char* X-SW-Source: 2002-11/txt/msg00740.txt.bz2 List-Id: >Number: 8586 >Category: c++ >Synopsis: Compiler should warn when converting a string literal to char* >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Thu Nov 14 14:36:02 PST 2002 >Closed-Date: >Last-Modified: >Originator: Matt Austern >Release: unknown-1.0 >Organization: >Environment: >Description: In C++, a string literal is of type const char[N]. However, there is a special conversion, just for string literals, that lets you assign a string literal to char*. This conversion is known to be unsafe, it was put in to support legacy code that isn't const-correct, and it is deprecated. The compiler should issue a warning when it applies that conversion. The only issue is whether that warning should be on or off by default. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: