cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, I need to force compiler option to signed char type as I porting a big project to stm32. Sorry but I not see how to do. :) Thanks

LPode.1
Associate II
 
10 REPLIES 10
LPode.1
Associate II

option to force UNSIGNED CHAR

depends on the compiler you are using

Thanks for your reply!

I using STM32CubeIDE for stm32F446, in the properties settings I see toolchain set to GNU tools for STM32

KnarfB
Principal III

-funsigned-char

:) BIG THANKS

Where should be added?

I trying in Properties->C/C++ Build->Settings->Tool Settings->MCU GCC Compiter->Miscellaneous->Other flags

but not works

can you give a source code line example what didn't work and what is the compiler message

void CCT_CrcIns(char pos,char bb) { cct_crc_buffer[pos] = bb; }

this is one of the lines that generates the warning: array subscript has type 'char' [-Wchar-subscripts]

if I change char to unsigned char then the code not generates the warning

I used IAR for arm and all chars were unigned as default.

Project is very big and wuold be better for me to put unsigned char as default.

I worte -funsigned-char in the miscellaneus but seems not ok

Thanks lot your help

I debugging with some char trials and seems to work. Still have the warnings, I will fix any line in program.

:) Thanks

KnarfB
Principal III

That's another warning. char remains a separate type and so that warning remains regardless of signed/unsigned.