You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use tneo in my samd21 (m0+) project. Since I have my own build engine based on python, I'm doing the "build manually" route. One of the options I compile with is -Wcast-align. However, doing so is producing the following error:
/Users/travisg/Projects/twig_lora_tneo/TNEO/core/tn_fmem.c: In function 'tn_fmem_create':
/Users/travisg/Projects/twig_lora_tneo/TNEO/core/tn_fmem.c:333:20: error: cast increases required alignment of target type [-Werror=cast-align]
p_tmp = (void **)p_block;
I'm not sure what the best way to get around this is. I can remove that option, but once upon a time, I had convinced myself that was a good thing to check for.
The text was updated successfully, but these errors were encountered:
I think as both start_address and block_size are aligned values, you are safe to use void* instead of unsigned char* here, so the whole block would be:
void **p_tmp;
void *p_block;
int i;
p_tmp = (void **)fmem->start_addr;
p_block = (unsigned char*)fmem->start_addr + fmem->block_size;
.... loop comes here
But then of course you'll get "pointer of type ‘void *’ used in arithmetic",
i've fixed it in this way:
I'm trying to use tneo in my samd21 (m0+) project. Since I have my own build engine based on python, I'm doing the "build manually" route. One of the options I compile with is
-Wcast-align
. However, doing so is producing the following error:I'm not sure what the best way to get around this is. I can remove that option, but once upon a time, I had convinced myself that was a good thing to check for.
The text was updated successfully, but these errors were encountered: