Warning: Sun f77 1.4 beta clashes with yacc generated C code

Simon Pigot esri!atlas!simon at uunet.uu.net
Tue Mar 19 03:28:00 AEST 1991


Severe problems occur when using fortran 1.4 beta with C code generated
using yacc. It seems that fortran 1.4 beta uses a yacc parser to parse
fortran format specifications. Unfortunately the symbols used by their
yacc parser conflict with those of any local yacc parsers called - the
result is total confusion during formatted i/o including spurious error
messages most often reflecting format statements which have been mangled
because of the clash.

eg: This program has a C main which uses a yacc parser, at one stage it
    calls a fortran program which happens to do some formatted internal i/o. 
    The following error message results because of clashes between the f77
    1.4 compiler fortran format yacc parser and the local yacc parser.

ifio: [100] error in format
lately: writing sequential formatted internal IO
part of last format: (I5)
part of last string: |

Proof:

If you use nm(1) on libF77.so.1.4 you can see the yacc symbols and 
entrypoints the compiler wants to use:

		0005c9f0 D _yyact
		00000004 C _yychar
		0005cfb8 D _yychk
		00000004 C _yydebug
		0005d128 D _yydef
		00000004 C _yyerrflag
		00042f90 T _yyerror
		0005c990 D _yyexca
		00042934 T _yylex
		00000004 C _yylval
		00000004 C _yynerrs
		0005cbd0 D _yypact
		00041ac0 T _yyparse
		0005cd40 D _yypgo
		0005ea04 b _yyps
		0005ea00 b _yypv
		0005cd70 D _yyr1
		0005ce94 D _yyr2
		0005e9fc b _yys
		0005ea08 b _yystate
		0005ea0c b _yytmp
		0005e9f8 b _yyv
		00000004 C _yyval

Some of the yacc parser data structures are statics but others are
not.....  Some of these are entrypoints (yyparse, yylex and yyerror) and
get confused with the local yacc parser entrypoints.....

I hope the sun fortran people fix this before the final 1.4 release. 

Simon Pigot,                                               (spigot at esri.com)
Environmental Systems Research Institute,
380 New York Street,
Redlands, Ca. 92373                          Phone: (714) 793-2853 ext. 1479



More information about the Comp.sys.sun mailing list