OrbitControls.dampingFactor
我的程序有这样的内容。我收到如下所示的valgrind错误:
struct A {
A() : a(0), b_1(0), b_2(0), c(0) {}
int a=0;
int b_1: 9;
int b_2: 23;
int c=0;
};
void func1(int i, int j, int k) { //<<<< valgrind error at this line.
}
void func2() {
int aa = 11;
int cc = 12;
A a;
a.b_2 = -1;
func1(2, a.b_2, cc );
}
我怀疑是因为==25167== Uninitialised value was created by a stack allocation
==25167== at 0x122A00E9: func1(int, int, int)
是23位,并且我们将其分配给32位整数a.b_2
,这会导致未初始化的字节错误吗?
分配给j时,此-1可以失去其值吗?
这是正确的吗?