() {
demo_counter * p_fresh = malloc( sizeof( demo_counter ) );
if ( 0 != p_fresh ) {
p_fresh->m_count = 0;
p_fresh->destroy = demo_counter_destroy;
p_fresh->count = demo_counter_count;
}
return p_fresh;
}
static void demo_counter_destroy( demo_counter * self ) {
free( self );
}
static int demo_counter_count( demo_counter * self, int count_amt ) {
self->m_count += count_amt;
return self->m_count;
}
--
Summary: not following "right-then-left" rule when compiling
function pointers
Product: gcc
Version: 4.3.2
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dj2con at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40627
--- Comment #3 from dj2con at gmail dot com 2009-07-03 14:42 ---
(In reply to comment #1)
> (In reply to comment #0)
> > , but it does not seem to recognize that the following is also a valid
> > prototype:
> >
> > int count * ( demo_counter * self, int
--- Comment #5 from dj2con at gmail dot com 2009-07-03 15:29 ---
I was still curious, so I re-read section 6.7.5.3 of the standard. And having
re-read it, I would like to apologize for troubling everyone -- upon re-reading
6.7.5.3, it now seems obvious that I was mis-applying the