[cc65] ca65: Global scope specifier required in "constant expressions"??

From: Agent Friday <64subnet1gmail.com>
Date: 2011-07-05 03:45:54
I've been getting the "constant expression expected" error where I
don't think I should be.  I isolated the issue to the conditional
assembly directive being inside a .proc scope vs. being in global

To re-create:
> cl65 --version
cl65 V2.13.2 - (C) Copyright 1998-2009 Ullrich von Bassewitz

> cl65 t.s
t.s(11): Error: Constant expression expected

> type t.s

comm_port = $dc01
comm_port = $dd01

.PROC test_irq
.IF USE_JOYPORT       ; <-- Line 11
  lda   #$F9
  sta   comm_port +2     ; ddr


I found that changing the second reference (the one inside the .PROC)
to ::USE_JOYPORT fixes the error, but it seems this should not be

According to section 7.7 Scope Search Order, the search should
automatically look outward if a symbol is not found in the current
scope.  Is there some reason this isn't happening in this example?

// Agent Friday
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Jul 5 03:46:03 2011

This archive was generated by hypermail 2.1.8 : 2011-07-05 03:46:07 CEST