patches for Sun Forte 7/8 compilers

Stefan Teleman steleman at nyc.rr.com
Mon Nov 3 23:03:25 GMT 2003


the compiler complains because in the header file, the function 
(signal() for example) is declared #ifdef __cplusplus "extern "C {" 
#endif -- etc with corresponding braces at the end. so, it expects an 
"extern C" function pointer with arguments. because the signal 
handler function itself is not "extern C", but C++, its name and 
signature are mangled. so the compiler is required to complain 
because a pointer to a C++-linkage function with its arguments is 
being passed to an "extern C" linkage function which expects a 
pointer to an "extern C" linkage function (not mangled).

--Stefan

-----

On Monday 03 November 2003 17:20, Oswald Buddenhagen wrote:
> On Mon, Nov 03, 2003 at 06:12:29PM -0400, Stefan Teleman wrote:
> > because in terms of the language standard, "extern C" linkage is
> > different than just simple free-standing C++ functions which,
> > although they are not member functions of anything -- therefore
> > no 'this' pointer -- still acquire C++ linkage. Same goes for
> > static member functions -- strict compilers will at least issue a
> > warning about non "extern C" linkage, for the same reason.
>
> i know all this, but i still don't get it. sigaction just takes a
> pointer to a function that takes certain arguments. is the compiler
> allowed to do weird things to the argument list if the linkage is
> not "C", or what?
>
> greetings

-- 
Stefan Teleman          'Nobody Expects the Spanish Inquisition'
steleman at nyc.rr.com                          -Monty Python





More information about the kde-core-devel mailing list