struct t_struct {
int x;
int y;
}
t_void my_func2(t_void* hp, t_struct* st)
{
printf("show my_st, x: %d, y: %d", st.x, st.y);
}
int main() {
// call
struct t_struct st;
st.x = 100;
st.y = 200;
my_func2(&st);
return 0;
}
編譯沒有報(bào)錯(cuò)涩笤,上述代碼是。
調(diào)試幾次盒件,發(fā)現(xiàn)打印de都不對(duì)(真實(shí)情況非打拥疟獭),梳理好久炒刁,debug發(fā)現(xiàn)進(jìn)入函數(shù)前恩沽,數(shù)據(jù)完全正確,到了函數(shù)內(nèi)就亂碼翔始。
......(幾番折騰)才發(fā)現(xiàn)罗心,調(diào)用得接口參數(shù)不一致。
奇怪:vs2017居然不報(bào)錯(cuò)城瞎,只有警告渤闷。