"Gloria, Jing" wrote:
Pls advise if there is a way to make GPC accept a field name in a RECORD or variable name and that field name or variable name is a reserved or key word in GPC. I am porting software from SPARC SunOS (using SUN PASCAL compiler) to INTEL Solaris 7 (using GPC). For example :
EXAMPLE A:
PROCEDURE Blkkut;
VAR Trow, Tline_nbr, Tcnt :INTEGER; Tptr :Parm_ptr; Tmp_erlin :Er_typ; View :BOOLEAN; Repos :INTEGER;
BEGIN (* Blkkut *) IF Slct_flg THEN BEGIN View := FALSE; Blkcopy(View); <<< this is line 349; View is a GPC reserved word. IF NOT Spare_buffer_used THEN
I get the following errors during compile: Shared_tpl/Mprocsrc/blockcmd.p: In procedure `Blkkut': Shared_tpl/Mprocsrc/blockcmd.p:349: parse error before `View' Shared_tpl/Mprocsrc/blockcmd.p:349: missing `)' Shared_tpl/Mprocsrc/blockcmd.p:349: too few arguments to function `Blkcopy' Shared_tpl/Mprocsrc/blockcmd.p:349: parse error before `)'
EXAMPLE B:
Sortmask_rec = PACKED RECORD Bin_nbr :Int8; Class :Class_typ;
<<< line 226 Class is a GPC reserve word. Any :BOOLEAN; Display_ch :Displ_char; Socket_quality_delta :INT16; Test_Sum :INT16; Test_List :PACKED ARRAY[1..Maximum_tests] of INT16; END;
Error messages during compile. In file included from Shared_tpl/Inc/tplmain.typ:38, from Shared_tpl/Mprocsrc/blockcmd.p:67: Dependent/Inc/misc.typ:226: parse error before `Class' Dependent/Inc/misc.typ:226: extra semicolon
I am using gpc version 20010623, based on 2.95.2 19991024 (release) and I use only -O and --no-mixed-comments options when calling gpc.
I think if you use --extended-pascal or --standard-pascal that will go away. Info gpc should lead you straight to the applicable documentation.