I get these compiler warnings when trying to compile anything with the nuklear.h header.
1>tfury_nuklear.c
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear\nuklear.h(5668,47): warning C5287: operands are different enum types 'nk_panel_set' and 'nk_panel_type'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear\nuklear.h(5669,42): warning C5287: operands are different enum types 'nk_panel_set' and 'nk_panel_type'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear\nuklear.h(5761,46): warning C5287: operands are different enum types 'nk_window_flags' and 'nk_panel_flags'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear\nuklear.h(6935,34): warning C4127: conditional expression is constant
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear\nuklear.h(10067,29): warning C4127: conditional expression is constant
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear\nuklear.h(29037,49): warning C5287: operands are different enum types 'nk_edit_types' and 'nk_edit_flags'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear\nuklear.h(30275,1): warning C4701: potentially uninitialized local variable 'text' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear\nuklear.h(30172,1): warning C4701: potentially uninitialized local variable 'sym_background' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\nuklear_console_label.h(78,1): warning C4700: uninitialized local variable 'handle' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\nuklear_console.h(1038,1): warning C4700: uninitialized local variable 'handle' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear\nuklear.h(23944,1): warning C4701: potentially uninitialized local variable 'label' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear\nuklear.h(25629,1): warning C4701: potentially uninitialized local variable 'text' usedActivity
20Would you mind retesting with latest master?
Line numbers don't match. Probably, because you have a bit older version.
I was able to track the first 5, and there's nothing wrong in these, but the later ones about uninitialized local variable might be important.
EDIT: moved this section to https://github.com/Immediate-Mode-UI/Nuklear/issues/958#issuecomment-4450818949
Would you mind retesting with latest master?
Line numbers don't match. Probably, because you have a bit older version.
I was able to track the first 5, and there's nothing wrong in these, but the later ones about uninitialized local variable might be important.
EDIT: moved this section to https://github.com/Immediate-Mode-UI/Nuklear/issues/958#issuecomment-4450818949
I think I have it up to date now?
1>tfury_nuklear.c
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(3727,37): warning C5287: operands are different enum types 'nk_edit_types' and 'nk_edit_flags'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(5642,47): warning C5287: operands are different enum types 'nk_panel_set' and 'nk_panel_type'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(5643,42): warning C5287: operands are different enum types 'nk_panel_set' and 'nk_panel_type'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(5735,46): warning C5287: operands are different enum types 'nk_window_flags' and 'nk_panel_flags'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(6909,34): warning C4127: conditional expression is constant
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(10041,29): warning C4127: conditional expression is constant
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(25961,53): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(29007,49): warning C5287: operands are different enum types 'nk_edit_types' and 'nk_edit_flags'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(30142,1): warning C4701: potentially uninitialized local variable 'sym_background' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(30245,1): warning C4701: potentially uninitialized local variable 'text' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\nuklear_console_label.h(78,1): warning C4700: uninitialized local variable 'handle' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\nuklear_console.h(1038,1): warning C4700: uninitialized local variable 'handle' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(23918,1): warning C4701: potentially uninitialized local variable 'label' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(25603,1): warning C4701: potentially uninitialized local variable 'text' usedI think I have it up to date now?
1>tfury_nuklear.c
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(3727,37): warning C5287: operands are different enum types 'nk_edit_types' and 'nk_edit_flags'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(5642,47): warning C5287: operands are different enum types 'nk_panel_set' and 'nk_panel_type'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(5643,42): warning C5287: operands are different enum types 'nk_panel_set' and 'nk_panel_type'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(5735,46): warning C5287: operands are different enum types 'nk_window_flags' and 'nk_panel_flags'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(6909,34): warning C4127: conditional expression is constant
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(10041,29): warning C4127: conditional expression is constant
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(25961,53): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(29007,49): warning C5287: operands are different enum types 'nk_edit_types' and 'nk_edit_flags'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(30142,1): warning C4701: potentially uninitialized local variable 'sym_background' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(30245,1): warning C4701: potentially uninitialized local variable 'text' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\nuklear_console_label.h(78,1): warning C4700: uninitialized local variable 'handle' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\nuklear_console.h(1038,1): warning C4700: uninitialized local variable 'handle' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(23918,1): warning C4701: potentially uninitialized local variable 'label' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(25603,1): warning C4701: potentially uninitialized local variable 'text' usedI think I have it up to date now?
1>tfury_nuklear.c
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(3727,37): warning C5287: operands are different enum types 'nk_edit_types' and 'nk_edit_flags'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(5642,47): warning C5287: operands are different enum types 'nk_panel_set' and 'nk_panel_type'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(5643,42): warning C5287: operands are different enum types 'nk_panel_set' and 'nk_panel_type'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(5735,46): warning C5287: operands are different enum types 'nk_window_flags' and 'nk_panel_flags'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(6909,34): warning C4127: conditional expression is constant
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(10041,29): warning C4127: conditional expression is constant
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(25961,53): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(29007,49): warning C5287: operands are different enum types 'nk_edit_types' and 'nk_edit_flags'; use an explicit cast to silence this warning
1>(compiling source file 'backend/tfury_nuklear.c')
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(30142,1): warning C4701: potentially uninitialized local variable 'sym_background' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(30245,1): warning C4701: potentially uninitialized local variable 'text' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\nuklear_console_label.h(78,1): warning C4700: uninitialized local variable 'handle' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\nuklear_console.h(1038,1): warning C4700: uninitialized local variable 'handle' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(23918,1): warning C4701: potentially uninitialized local variable 'label' used
1>D:\sourcecode\TerminalFury\TerminalFury\core\backend\nuklear_console\vendor\Nuklear\nuklear.h(25603,1): warning C4701: potentially uninitialized local variable 'text' usedchecked on 5a54a9f677ead97a581b5c8ab83cc30fdf237885
nuklear.h(5655,47): warning C5287: operands are different enum types 'nk_panel_set' and 'nk_panel_type'; use an explicit cast to silence this warning nuklear.h(5656,42): warning C5287: operands are different enum types 'nk_panel_set' and 'nk_panel_type'; use an explicit cast to silence this warning
nuklear.h(5748,46): warning C5287: operands are different enum types 'nk_window_flags' and 'nk_panel_flags'; use an explicit cast to silence this warning
nuklear.h(6924,34): warning C4127: conditional expression is constant
nuklear.h(10056,29): warning C4127: conditional expression is constant
nuklear.h(29022,49): warning C5287: operands are different enum types 'nk_edit_types' and 'nk_edit_flags'; use an explicit cast to silence this warning
nuklear.h(23933) : warning C4701: potentially uninitialized local variable 'label' used
nuklear.h(30260) : warning C4701: potentially uninitialized local variable 'text' used
nuklear.h(30157) : warning C4701: potentially uninitialized local variable 'sym_background' used
checked on 5a54a9f677ead97a581b5c8ab83cc30fdf237885
nuklear.h(5655,47): warning C5287: operands are different enum types 'nk_panel_set' and 'nk_panel_type'; use an explicit cast to silence this warning nuklear.h(5656,42): warning C5287: operands are different enum types 'nk_panel_set' and 'nk_panel_type'; use an explicit cast to silence this warning
nuklear.h(5748,46): warning C5287: operands are different enum types 'nk_window_flags' and 'nk_panel_flags'; use an explicit cast to silence this warning
nuklear.h(6924,34): warning C4127: conditional expression is constant
nuklear.h(10056,29): warning C4127: conditional expression is constant
nuklear.h(29022,49): warning C5287: operands are different enum types 'nk_edit_types' and 'nk_edit_flags'; use an explicit cast to silence this warning
nuklear.h(23933) : warning C4701: potentially uninitialized local variable 'label' used
nuklear.h(30260) : warning C4701: potentially uninitialized local variable 'text' used
nuklear.h(30157) : warning C4701: potentially uninitialized local variable 'sym_background' used
checked on 5a54a9f677ead97a581b5c8ab83cc30fdf237885
nuklear.h(5655,47): warning C5287: operands are different enum types 'nk_panel_set' and 'nk_panel_type'; use an explicit cast to silence this warning nuklear.h(5656,42): warning C5287: operands are different enum types 'nk_panel_set' and 'nk_panel_type'; use an explicit cast to silence this warning
nuklear.h(5748,46): warning C5287: operands are different enum types 'nk_window_flags' and 'nk_panel_flags'; use an explicit cast to silence this warning
nuklear.h(6924,34): warning C4127: conditional expression is constant
nuklear.h(10056,29): warning C4127: conditional expression is constant
nuklear.h(29022,49): warning C5287: operands are different enum types 'nk_edit_types' and 'nk_edit_flags'; use an explicit cast to silence this warning
nuklear.h(23933) : warning C4701: potentially uninitialized local variable 'label' used
nuklear.h(30260) : warning C4701: potentially uninitialized local variable 'text' used
nuklear.h(30157) : warning C4701: potentially uninitialized local variable 'sym_background' used
No, it was not, but I was able to repro anyway: https://godbolt.org/z/s8WoeEeY5
The warnings about conditional expression is constant are bogus and don't appear in newer MSVC version. The one about if(sizeof(nk_draw_index)==2) NK_ASSERT( can be fixed, but if (sizeof(unsigned int) > 2) cannot.
The ones about operands are different enum types are probably fine to ignore. Not sure, if we should cast them because it may create a mess. I'll check how the rest of library deals with it.
The ones about potentially uninitialized local variable might be actual bugs. I would have to take a look. Maybe there is some branch being skipped there. Memseting those variables to 0 will silence the warnings, but it's unwise.
No, it was not, but I just reproduced it myself: https://godbolt.org/z/s8WoeEeY5
conditional expression is constant are bogus and don't appear in newer MSVC version. if(sizeof(nk_draw_index)==2) NK_ASSERT( can be fixed, but if (sizeof(unsigned int) > 2) cannot.
operands are different enum types are probably fine to ignore. Not sure, if we should cast them because it may create a mess. I'll check how the rest of library deals with it. EDIT: I don't see any casts in other enum definitions.
potentially uninitialized local variable might be actual bugs. There might be some branch being skipped. Memset'ing those variables to 0 will silence the warnings, but it's unwise.
No, it was not, but I just reproduced it myself: https://godbolt.org/z/s8WoeEeY5
conditional expression is constant are bogus and don't appear in newer MSVC version. if(sizeof(nk_draw_index)==2) NK_ASSERT( can be fixed, but if (sizeof(unsigned int) > 2) cannot.
operands are different enum types are probably fine to ignore. Not sure, if we should cast them because it may create a mess. I'll check how the rest of library deals with it. EDIT: I don't see any casts in other enum definitions.
potentially uninitialized local variable might be actual bugs. There might be some branch being skipped. Memset'ing those variables to 0 will silence the warnings, but it's unwise.
Anyway, thanks. I may take a look into these someday.
Next time, please make sure to check against actual master and give more info about your setup (compiler version, flags, etc) Even though I know it's MSVC, and I know how to use it, others may not, and it still took me some time to figure out what's going on.
Anyway, thanks. I may take a look into these someday.
Next time, please make sure to check against actual master and give more info about your setup (compiler version, flags, etc) Even though I know it's MSVC, it still took me some time to figure out what's going on.
Anyway, thanks. I may take a look into these someday.
Next time, please make sure to check against actual master and give more info about your setup (compiler version, flags, etc) Even though I know it's MSVC, it still took me some time to figure out what's going on.
I was using the nuklear submodule that came with nuklear_console, guess it wasn't up to date, apologies.
I was using the nuklear submodule that came with nuklear_console, guess it wasn't up to date, apologies.
Ah, fixed! Thanks.
@RobLoach wut? Why did you close this one?
Thought StrikerTheHedgefox updating his submodules fixed it 🤷 ... Still an issue?
Would you mind retesting with latest master?
Line numbers don't match. Probably, because you have a bit older version.
I was able to track the first 5, and there's nothing wrong in these, but the later ones about
uninitialized local variablemight be important.EDIT: moved this section to https://github.com/Immediate-Mode-UI/Nuklear/issues/958#issuecomment-4450818949