> Jochen> "../src/lyx_main.C", line 148: Warning (Anachronism): Formal
> Jochen> argument 2 of type extern "C" void(*)(int) in call to
> Jochen> signal(int, extern "C" void(*)(int)) is being passed
> Jochen> void(*)(int).  [...]  "lyxvc.C", line 337: Warning
> Jochen> (Anachronism): Formal argument 2 of type extern "C"
> Jochen> int(*)(forms_*,void*) in call to fl_set_form_atclose(forms_*,
> Jochen> extern "C" int(*)(forms_*,void*), void*) is being passed
> Jochen> int(*)(forms_*,void*).
> 
> I do not really know what to do with those.

Judging from the warning text, it seems we are passing C++ functions as C
functions.  I suppose that might not work on some platforms, so we should
define C style linking for those callback functions.

I.e. if we have 

--
int foo(int bar) {
        ...
}

fl_set_form_atclose(blah, &foo);
--

we should do

--
extern "C" int foo(int bar) {

}

fl_set_form_atclose(blah, &foo);
--

instead.


In theory, the function start and exit code for a C function could be different
from the C++ equivalent one, but I doubt this happens in practice.  But I'm not
sure whether or not the C++ language should be able to perform the proper
wrapping (if needed) by itself or not, but it would not harm if we fixed this.
(Provided that the functions are global, and not member functions in which case
we are in trouble.)

Greets,

Asger

Reply via email to