On 03/24/12 16:41, Greg Ercolano wrote:
> On 03/24/12 14:39, Nikita Egorov wrote:
>> I think VS applies 'static' attribute only to first variable from list
>> ('no_fullscreen_x').
>
> I'm not sure that's the problem, at least not as a general
> case with 'static'. Though perhaps the DLL context is complicating
> things.
>
> Just for the record, the following compiled with VS2010:
Oops, meant to paste this instead:
C:\temp>type foo.cxx
#include <stdio.h>
class Bar {
static int ca,cb,cc;
public:
Bar() {
++ca; ++cb; ++cc;
printf("BAR: CA,CB,CC: %d %d %d\n", ca,cb,cc);
}
};
int Bar::ca = 100;
int Bar::cb = 200;
int Bar::cc = 300;
void foo() {
static int a=1,b=1,c=1,d=1;
printf("ABCD: %d %d %d %d\n", a,b,c,d);
a++; b++; c++; d++;
}
int main() {
foo(); foo(); foo();
new Bar();
new Bar();
new Bar();
return(0);
}
C:\temp>cl /TP foo.cxx
Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
foo.cxx
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
/out:foo.exe
foo.obj
C:\temp>foo
ABCD: 1 1 1 1
ABCD: 2 2 2 2 <-- expected static behavior
ABCD: 3 3 3 3
BAR: CA,CB,CC: 101 201 301
BAR: CA,CB,CC: 102 202 302 <-- expected static behavior
BAR: CA,CB,CC: 103 203 303
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk