Re: [cc65] another bug?

From: Karri Kaksonen <karri1sipo.fi>
Date: 2009-10-23 10:03:40
Groepaz wrote:
> On Freitag 23 Oktober 2009, Johan Kotlinski wrote:
>   
>> #include <assert.h>
>> void main() {
>>     char bar = -1;
>>     assert(bar < 0);
>> }
>>
>> ...warns "test.c(4): Warning: Condition is never true" and fails assert.
>>
>> cc65 V2.13.0, SVN version: 4384
>>     
>
> not a bug. char is signed by default with cc65. use either --signed-chars (i 
> think) or explicitly declare the char as signed.
>
>   
Oh no. I am afraid that you mean that "char is unsigned" by default.

Actually this is very confusing for me now. I always thought that

int  = signed
unsigned int = unsigned

char = signed
unsigned char = unsigned

Anyway all my code is written this way. I obviously need to add 
--signed-chars to all my Makefiles.

--
Regards,

Karri

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Oct 23 10:03:49 2009

This archive was generated by hypermail 2.1.8 : 2009-10-23 10:03:51 CEST