View previous topic :: View next topic |
Author |
Message |
cbarberis
Joined: 01 Oct 2003 Posts: 172 Location: Punta Gorda, Florida USA
|
|
Posted: Mon Dec 10, 2018 8:27 am |
|
|
I stand corrected, you are totally correct the PCD compiler by default uses the standard ANSI which is by default a signed int. Sometimes simple things like this elude me and I get in trouble. |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Mon Dec 10, 2018 9:24 am |
|
|
cbarberis wrote: | I stand corrected, you are totally correct the PCD compiler by default uses the standard ANSI which is by default a signed int. Sometimes simple things like this elude me and I get in trouble. |
Hey it eluded me about 6 or 7 years ago too. That's why I always pipe up whenever the subject of signed/unsigned and the PCD compiler comes up. |
|
|
dluu13
Joined: 28 Sep 2018 Posts: 395 Location: Toronto, ON
|
|
Posted: Mon Dec 10, 2018 11:15 am |
|
|
I've been caught by signed/unsigned differences as well. Now I always #include <stdint.h> and use the int8_t/uint8_t etc when defining my variables so I know what I'm getting. |
|
|
cbarberis
Joined: 01 Oct 2003 Posts: 172 Location: Punta Gorda, Florida USA
|
|
Posted: Mon Dec 10, 2018 11:23 am |
|
|
Good idea, I think from now on I will include these "signed and unsigned variable definitions" defines on my header file because you can spend a lot of times chasing problems that you don't need. |
|
|
|