From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28377 invoked by alias); 24 Sep 2003 18:14:40 -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 18881 invoked by uid 48); 24 Sep 2003 14:16:25 -0000 Date: Wed, 24 Sep 2003 18:36:00 -0000 From: "levon at movementarian dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20030924141618.12391.levon@movementarian.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/12391] New: regression: missing warning about assigning to an incomplete type X-Bugzilla-Reason: CC X-SW-Source: 2003-09/txt/msg01867.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=12391 Summary: regression: missing warning about assigning to an incomplete type Product: gcc Version: 3.4 Status: UNCONFIRMED Severity: minor Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: levon at movementarian dot org CC: gcc-bugs at gcc dot gnu dot org Consider: typedef struct { int a; } b_t; int foo() { b_t d; struct b_t * c = &d; c->a; } gcc 3.2 says : a.c: In function `foo': a.c:2: warning: initialization from incompatible pointer type a.c:2: dereferencing pointer to incomplete type GNU C version 3.4 20030914 (experimental) (i686-pc-linux-gnu) says : a.c: In function `foo': a.c:2: error: dereferencing pointer to incomplete type Note the missing warning on initialisation. This can be moderately confusing because the latter looks exactly like a "missing header" problem, but in fact the problem is prepending the "struct" before the typedef name, which is actually an incomplete type of "struct b_t". The missing warning makes it obvious that it's not as simple as a missing header.