From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3546 invoked by alias); 28 May 2010 16:53:14 -0000 Received: (qmail 3497 invoked by uid 48); 28 May 2010 16:53:03 -0000 Date: Fri, 28 May 2010 16:53:00 -0000 Subject: [Bug c/44316] New: "initialization from incompatible pointer type" struct initilization error handling X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "herron dot philip at googlemail dot com" 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: 2010-05/txt/msg03162.txt.bz2 This test case demonstrates what i mean: struct my_struct { int x; int (*hook_a)( void ); }; int func_a( void ) { return 1; } void func_b( void ) { func_a( ); } int main( void ) { struct my_struct a = { 1, &func_a }; struct my_struct b = { 2, &func_b }; return 0; } When initializing a struct it would be nice to have an error message detailing the field which has the incompatible pointer type. -- Summary: "initialization from incompatible pointer type" struct initilization error handling Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: herron dot philip at googlemail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44316