Re: GTK signals question.



On Wed, 05 Mar 2014 09:44:48 -0500
Chris Moller <moller mollerware com> wrote:
I was actually writing that testcase when I found a correlation: I'm 
using gcc and my callbacks were nested functions.  Pull the callbacks 
out and make them normal, top-level, functions, and it all works even 
without no blocking of any kind.  So, if this is a bug at all, I
suppose it could be a compiler bug.

Your question contained references to GTK+'s C interface.  If that
means that you are using C or C++ for your program, those languages do
not have a syntax for nested functions, so what you say does not really
make sense.  If you are simulating them in C++ using static methods of a
nested struct, in C++98 you have undefined behaviour if you try to use
them as a callback, because static member functions of classes with
local scope have no linkage (this follows because §3.5/5 of the standard
provides that a member function of class scope has external linkage if
the name of the class has external linkage, which it doesn't in the
case of local nested structs, and §3.5/8 provides that "Names not
covered by these rules have no linkage").

So it is most likely a misunderstanding on your part rather than a
compiler bug, but you would need to post your code to be sure.

Chris


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]