String comparisons
Sun, 21 Sep 1997 23:42:49 +0200
I just noticed that GPC ignores trailing spaces when comparing strings
with the usual operators ("=" and so on). I see that this seems to be
required by the standard, and that there are othere operators ("eq" or
such) for exact comparisions. However, I find this behaviour quite
inconsistent and annoying (took me quite some time to figure out why
s='' was true when s wasn't empty...)-:, and it would cause much trouble
when porting BP programs. When using "--borland-pascal", GPC says
"warning: ISO 7185 Pascal does not define string functions".
So, would it be possible to make "=" and so on work as exact comparisons
(at least in the "--borland-pascal" mode, and preferably also with a
separate switch)?
Simple test program: ;-)
program x;
begin
writeln(''=' ')
end.
Frank
--
Frank Heckenbach, Erlangen, Germany
heckenb@mi.uni-erlangen.de
http://home.pages.de/~fjf/links.htm
Frank Heckenbach (heckenb@mi.uni-erlangen.de)
HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada -
Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es