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


Robin Farine wrote:
> ISO/IEC 9899:1999 (E) 6.3.2.1 paragraph 4 says that a function designator,
> in two special cases excepted, is converted to a pointer to a function.

OK, but that's the wrong way round. Here, we've got a pointer to a
function and dereference it.

Not surprisingly, 6.5.3.2 paragraph 4 says that dereferencing a function
pointer yields a function designator. Of course, if you then want to
*call* that function, you have to apply the function call operator (AKA
()).

Just using a function designator by itself is not very useful, but of
course legal C, since it's only an expression whose result you ignore.
In that case, gcc even warns you about it (if you use -Wall - if you
don't, you deserve to loose ;-) because an expression without side
effects whose result you ignore is pretty pointless.

Martin


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