From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19835 invoked by alias); 16 Aug 2007 11:20:02 -0000 Received: (qmail 18439 invoked by uid 48); 16 Aug 2007 11:19:50 -0000 Date: Thu, 16 Aug 2007 11:20:00 -0000 Message-ID: <20070816111950.18438.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/33086] warn for read-only uninitialized variables passed as arguments In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "manu 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: 2007-08/txt/msg01067.txt.bz2 ------- Comment #2 from manu at gcc dot gnu dot org 2007-08-16 11:19 ------- (In reply to comment #1) > > At least for languages where 'const' is actually enforced > > There is none, void use(const int *a) { a[0] = 5; } void foo(void) { int i; use(&i); } new.c:3: error: assignment of read-only location Either I am misunderstanding you or your argument about overwriting the pointer argument is equivalent to just don't using the value of 'i'. Of course, we don't know whether the value is used or not within use() but the fact is that 'i' cannot be initialized within use(). -- manu at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu dot org Priority|P5 |P3 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33086