![](https://attach.openclonk.org/avatars/1-0778.png)
It's full of funny stuff like that:
warning: ‘C4Value* C4Value::NextRef’
Anybody got an idea where that comes from (and why it is that scrambled up)?
![](https://attach.openclonk.org/avatars/65-0196.png)
>It's full of funny stuff like that:
It's not only like that, it's exactly that. Around 2350 times.. :)
full example warning:
/home/ck/oc/oc-win32-mingw/openclonk/src/script/C4Value.h: In constructor ‘C4Value::C4Value()’:
/home/ck/oc/oc-win32-mingw/openclonk/src/script/C4Value.h:196: warning: ‘C4Value::Type’ will be initialized after
/home/ck/oc/oc-win32-mingw/openclonk/src/script/C4Value.h:193: warning: ‘C4Value* C4Value::NextRef’
/home/ck/oc/oc-win32-mingw/openclonk/src/script/C4Value.h:68: warning: when initialized here
That looks pretty valid to me. What is the problem with the one member being initialized after the other? Since when do you have to initialize members in the order of declaration?
Members are always initialized in the order of declaration, even if the order in the constructor's initializer list is different. This leads to code being executed in a different order than the one in the code, which can be confusing and therefore causes a warning.
![](https://attach.openclonk.org/avatars/29-2030.png)
Alternatively, we could just turn off this specific warning? :P
![](https://attach.openclonk.org/avatars/24-4666.png)
> Alternatively, we could just turn off this specific warning? :P
That's what I do. (-Wno-reorder, see WARNING_FLAGS in Makefile.am.) I think we had even a real bug that was caused by somebody carelessly silencing these warnings by changing the code, but no bug caught by them. That's pretty specific to our coding style, because the initialization lists are almost all trivial.
No, what happened was I changed the variable arrangement and you shouted at me because it increased sizeof(C4Value).
![](https://attach.openclonk.org/avatars/24-4666.png)
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill