gnucash unstable: Multiple changes pushed

Aaron Laws dartme18 at gmail.com
Fri Dec 29 12:06:59 EST 2017


>
> Ok, that's a good motivation. Just to be clear for me, having a function
> static is different from having a static variable, right ? As I understand
> it
> the latter is bad for thread safety, the former only ensures its local
> scope.


There two "static"s to keep in mind: static storage duration, and members
not bound to instances. Static functions are functions that can't be used
outside the current code file:

static void func () { printf ("can't be used outside " __FILE__); }
(or something like that.)

But very different is:

struct A { int a;  static int s_a; };
int A::s_a = 0;
int main () {
   printf ("%d is accessible.\n", A::s_a);
   //printf ("%d\n", A::a); this is illegal
   return 0;
}

Here, A::s_a can be accessed without ever creating an instance of "A".


More information about the gnucash-devel mailing list