From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1156 invoked by alias); 13 Jun 2003 04:58:59 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 31953 invoked by uid 48); 13 Jun 2003 04:58:25 -0000 Date: Fri, 13 Jun 2003 04:58:00 -0000 From: "charles@kde.org" To: gcc-bugs@gcc.gnu.org Message-ID: <20030613045823.11182.charles@kde.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/11182] New: gcc should warn when assigning unassigned variables X-Bugzilla-Reason: CC X-SW-Source: 2003-06/txt/msg01538.txt.bz2 List-Id: PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11182 Summary: gcc should warn when assigning unassigned variables Product: gcc Version: 3.3 Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: charles@kde.org CC: gcc-bugs@gcc.gnu.org in a block of code like this: int x; int y = x; I think gcc should warn that you're assigning x to y without x being modified. The real story is I wrote stupid code like this: void foo(Node *node) { for (Node *node = node->child; node; node = node->next) { ... } } (the meaning of this code is inconsequential, so I'm not providing a real sample) This error however could be fixed by reporting assignment from unmodified variables.