public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/44316]  New: "initialization from incompatible pointer type" struct initilization error handling
@ 2010-05-28 16:53 herron dot philip at googlemail dot com
  2010-05-28 16:58 ` [Bug c/44316] " tromey at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: herron dot philip at googlemail dot com @ 2010-05-28 16:53 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-05-28 17:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-28 16:53 [Bug c/44316] New: "initialization from incompatible pointer type" struct initilization error handling herron dot philip at googlemail dot com
2010-05-28 16:58 ` [Bug c/44316] " tromey at gcc dot gnu dot org
2010-05-28 17:12 ` joseph at codesourcery dot com
2010-05-28 17:15 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).