[fpc-devel] compilation error of h2pas.pas on Mac OS X

Dr. Karl-Michael Schindler schindler at physik.uni-halle.de
Wed Sep 21 09:13:21 CEST 2005


Dear Jan,

Am 21.09.2005 um 05:14 schrieb Jan Ruzicka:

> Hi
>
> Is there any workaround to make the FPC compile on darwin?

You can "manually" split the procedure yyaction, which is too long,  
into two and call the procedures in dependence of the parameter  
yyruleno. example:

rename procedure yyaction to procedure yyaction1

add the split at 100:

   99 : begin

          if not stripinfo then
          writeln(outfile,'(* Warning : default value for ',yyv 
[yysp-2]^.p,' ignored *)');
          hp:=new(presobject,init_one(t_default_value,yyv[yysp-0]));
          yyval:=new(presobject,init_three(t_dec,nil,yyv[yysp-2],hp));

        end;
   end;
end(*yyaction1*);

procedure yyaction2 ( yyruleno : Integer );
   (* local definitions: *)
begin
   (* actions: *)
   case yyruleno of
  100 : begin

and replace the call of yyaction(-yyn) (somewhere around line 8500 ) by:

   if -yyn < 100 then
       yyaction1(-yyn)
   else
     yyaction2(-yyn);

> Is there any way I can help?

Probably not. It is a "Jonas Maebe class of problem" and he is  
working on it.

> Thanks
>
> Jan
>
> On Sep 17, 2005, at 05:34, Florian Klämpfl wrote:
>
>> Dr. Rolf Jansen wrote:
>>
>>> since some days I am no more able to "make all" the latest and   
>>> greatest fpc from SVN sources, because there are compilation  
>>> errors  for h2pas.pas.

snip snap

>>> Any suggestions are welcome.
>>
>> This is a known problem, it's a bug in the powerpc code generator,  
>> Jonas is already working on it afaik.
>>
>> Background: h2pas.pas is generated by yacc from h2pas.y and  
>> generates a huge procedure which a real programmer would never  
>> create, that's why it poped up so late.





More information about the fpc-devel mailing list