Re: [cc65] Re: Problem with generating o65 files

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2005-01-21 14:21:47
Hi!

On Fri, Jan 21, 2005 at 01:49:28PM +0100, Spiro Trikaliotis wrote:
> According to ca65-3.html#ss3.3, ca65 does not expect a plus sign for a
> decimal number, so I believe this would be a bug in co65, not in ca65.

No, it's a bug in ca65. A unary plus should of course be allowed. The unary
plus operator is listed in the "Available operators" section of the ca65
manual, but it doesn't work. Here is the necessary patch (apply to
src/ca65/expr.c):

-----------------------------------------------------------------------------
*** expr.c~     2004-07-18 00:13:35.000000000 +0200
--- expr.c      2005-01-21 13:56:44.000000000 +0100
***************
*** 810,815 ****
--- 810,820 ----
            NextTok ();
            break;

+         case TOK_PLUS:
+             NextTok ();
+             N = Factor ();
+             break;
+
        case TOK_MINUS:
              NextTok ();
              L = Factor ();
-----------------------------------------------------------------------------

> Ok. As you already know, I am not interested in Lunix, but in the
> 1541/1571/1581 drives with (x)o65 files. Do you recommend another better
> option?

I don't know of a better option.

> ld65-5.html#ss5.8 does not mention if other OS versions than
> Lunix are supported. http://www.6502.org/users/andre/o65/fileformat.html
> mentions the OSA/65 header supplement, and you told me that there is a
> version for cc65 use.

Version of what?

> BTW: To compile the cc65 package on my cygwin box [1], I had to make
> sure that src/common/inttypes.h includes stdint.h instead of defining
> the own types, or I get an error.
>
> Trying to check for __STDC_VERSION__ with a simple test source [2], I
> get "No __STDC_VERSION__", so I do not know how this can be
> distinguished.

This means that the compiler is not conforming to the ISO C99 standard, which
states that __STDC_VERSION__ must be a predefined macro. The problem why the
code doesn't work is probably that the compiler doesn't define
__STDC_VERSION__, but seems to include stdint.h (which is a header file new in
C99) somewhere, so there are name collisions. Unfortunately, there's not much
I can do about it. I would say it's a cygwin problem. The compiler should
either say that it's C99 conformant, or not use any identifiers new in C99.
BTW: cc65 doesn't define __STDC_VERSION__ either, but the case is somewhat
different ...

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
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 Jan 21 14:21:51 2005

This archive was generated by hypermail 2.1.8 : 2005-01-21 14:22:02 CET