This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Possible bug in dbg-threads-syscall.c


I guess C defines '*f' as a "function" :-P

Seriously, since C allows this:

    typedef int int_fun(int);

then the type 'int_fun' represents the set of functions that take an int in
argument and that return an int. Then,

    int_fun* int_fun_ptr;

naturally defines a pointer to such functions and 

    int_fun zozo;

represents a prototype declaration for the function 'zozo'. This differs from
"usual" declarations in that 'zozo' doesn't represent a variable, i.e.

    zozo = ...;

would fail for anything at the right side.

HTMS,

Robin


"Patrick Doyle" <wpd@delcomsys.com> writes:

> In my CVS net source tree, 'dbg_syscall_ptr' is the double pointer to a
> function, 'f' is defined as 'dbg_syscall_func', which is a singler pointer
> to a function.  I was just expressing curiosity as to what the heck the C
> language defines '*f' to be when 'f' is a declared as a (single) pointer to
> a function.
> 
> --wpd
> 
> >
> > > I am curious, however, if 'f' is a pointer to a function, what,
> > exactly does
> > > '*f' mean?
> >
> > For some reason I'm not entirely sure about, f is a double pointer to a
> > function. i.e. a pointer to a pointer to a function.
> >
> > Jifl


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]