impcc
Active member
The code is as simple as this:
And what I see when I go to build, I get all these warnings. I'm one of those "no warnings" people, so while it compiles successfully, I'm left left a little twitchy.
Any ideas on how to get these to go away, even if it's just using some sort of #pragma to suppress the warning?
Thanks for helping!
-Ian
Code:
#include <TeensyThreads.h>
And what I see when I go to build, I get all these warnings. I'm one of those "no warnings" people, so while it compiles successfully, I'm left left a little twitchy.
Code:
.pio/libdeps/teensy41/TeensyThreads/TeensyThreads.cpp: In member function 'void Threads::idle()':
.pio/libdeps/teensy41/TeensyThreads/TeensyThreads.cpp:682:7: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
682 | if (! threadp[i]) continue;
| ^~
.pio/libdeps/teensy41/TeensyThreads/TeensyThreads.cpp:683:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
683 | if (threadp[i]->sleep_time_till_end_tick > threadp[j]->sleep_time_till_end_tick) {
| ^~
.pio/libdeps/teensy41/TeensyThreads/TeensyThreads.cpp:715:7: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
715 | if (! threadp[i]) continue;
| ^~
.pio/libdeps/teensy41/TeensyThreads/TeensyThreads.cpp:716:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
716 | if (needs_run[i]) {
| ^~
.pio/libdeps/teensy41/TeensyThreads/TeensyThreads.cpp: At global scope:
.pio/libdeps/teensy41/TeensyThreads/TeensyThreads.cpp:371:13: warning: 'void context_pit_empty()' defined but not used [-Wunused-function]
371 | static void context_pit_empty() {}
| ^~~~~~~~~~~~~~~~~
.pio/libdeps/teensy41/TeensyThreads/TeensyThreads.cpp: In constructor 'Threads::Threads()':
.pio/libdeps/teensy41/TeensyThreads/TeensyThreads.cpp:262:42: warning: array subscript -2560 is outside array bounds of 'long unsigned int [1]' [-Warray-bounds]
262 | threadp[0]->stack = (uint8_t*)&_estack - DEFAULT_STACK0_SIZE;
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
.pio/libdeps/teensy41/TeensyThreads/TeensyThreads.cpp:66:22: note: while referencing '_estack'
66 | extern unsigned long _estack; // the main thread 0 stack
| ^~~~~~~
.pio/libdeps/teensy41/TeensyThreads/TeensyThreads.cpp:482:6: warning: array subscript -2560 is outside array bounds of 'long unsigned int [1]' [-Warray-bounds]
482 | *m = thread_marker;
| ~~~^~~~~~~~~~~~~~~
.pio/libdeps/teensy41/TeensyThreads/TeensyThreads.cpp:66:22: note: while referencing '_estack'
66 | extern unsigned long _estack; // the main thread 0 stack
| ^~~~~~~
Any ideas on how to get these to go away, even if it's just using some sort of #pragma to suppress the warning?
Thanks for helping!
-Ian