Hi,
I get the error "Array index out of bounds, cannot determine dbIdent is less than 10".
This is my code:
for(uint8_t dbIdent = 0; 10 > dbIdent; dbIdent++) { if(databaseEntry[dbIdent].testVar == testVar) { // Do something } }
But in the for loop it checks if dbIdent is less than 10 anyway?
Any help with this is appreciated. Thanks.
Can you show a minimal example that reproduces the problem? How is databaseEntrydeclared?
databaseEntry
typedef struct { uint8_t testVar; }databaseEntry_t; static databaseEntry_t databaseEntry[10] = {0};
Which version do you use? No warning:
typedef struct { uint8_t testVar; }databaseEntry_t; static databaseEntry_t databaseEntry[10] = {0}; void f(uint8_t testVar) { for (uint8_t dbIdent = 0; 10 > dbIdent; dbIdent++) { if(databaseEntry[dbIdent].testVar == testVar) { // Do something } } }
Okay thank you. Currently I'm using 2.7 still I believe the newer versions got rid of bug hunting? Which version did you use?
Thanks.
Log in to post a comment.
Hi,
I get the error "Array index out of bounds, cannot determine dbIdent is less than 10".
This is my code:
But in the for loop it checks if dbIdent is less than 10 anyway?
Any help with this is appreciated.
Thanks.
Can you show a minimal example that reproduces the problem? How is
databaseEntry
declared?Last edit: Joe 2023-09-26
Which version do you use?
No warning:
Okay thank you.
Currently I'm using 2.7 still I believe the newer versions got rid of bug hunting?
Which version did you use?
Thanks.