> abcpqr70 wrote:
> > i have this line in my code:-
> > err->pu.error_exit =error_exit;
> > 
> > when i try to compile it,i get this error:-
> > 
> > error: a value of type "void (*)(j_common_ptr)"
> > cannot be assigned to an entity of type "void
> > (*)(j_common_ptr) C"
> > 
> > what probably is this??-  void (*)(j_common_ptr) C

It almost certainly means that pu.error_exit is a
pointer to a function with C++ linkage, but error_exit
has C linkage. Hence, they are incompatible.

C++ compilers are _extremely_ fussy about types. C++
linkage is not limited to 'name mangling', it also
affects how functions are called. I've seen a few
systems where the C and C++ calling conventions are
different. [E.g. one old Mac O/S implementation used
a register to return values for C functions, but used
the stack to return values for C++ functions.]

Thomas Hruska <thru...@...> wrote:
> http://forums.nvidia.com/index.php?showtopic=81690
> 
> Found several threads like that.  Appears to be a rogue
> C compiler pretending to be a C++ compiler in the
> typecasting department.

Or it may be a legitimate C++ compiler and the OP is the
'rogue' pretending that C and C++ are the same. ;-)

> What compiler are you using?

And how is it invoked? Note that some compilers will compile
.cpp files as C++ even when notionally invoked as C compilers.

-- 
Peter

Reply via email to