g77 i.ne.'ff'x bombs...
Toon Moene
toon@moene.indiv.nluug.nl
Mon Jan 19 13:34:00 GMT 1998
> The following code does not compile. It complains that 'ff'x is
> not an arithmetic entity which I believe it should be... Steve.
> program g77test1
> implicit none
> integer i,j
> i = 1
> j = 'ff'x
> print *,j,' = ','ff'x
> if (i .ne. j) then
> print *,'ok got here'
> endif
> if (i .ne. 'ff'x) then
> print *,'ok got further'
> endif
> end
Wellllll, you can believe anything you want, of course, but you
won't be backed up by the Standard (none of them - 66, 77, 90 or
95). This is just plain an extension, and an ugly one at that.
So compile with -fugly:
% grep ugly .../egcs-980115/gcc/f/lang-options.h
"-fugly",
"-fno-ugly",
"-fugly-args",
"-fno-ugly-args",
"-fugly-assign",
"-fno-ugly-assign",
"-fugly-assumed",
"-fno-ugly-assumed",
"-fugly-comma",
"-fno-ugly-comma",
"-fugly-complex",
"-fno-ugly-complex",
"-fugly-init",
"-fno-ugly-init",
"-fugly-logint",
"-fno-ugly-logint",
% /usr/test/bin/g77 -fugly adler.f
f771: warning: -fugly is overloaded with meanings and likely to be
removed;
f771: warning: use only the specific -fugly-* options you need
% ./a.out
255 = 255
ok got here
ok got further
%
To find out which -fugly suboption is necessary and sufficient
(wlog) is left as an exercise to the reader :-)
Cheers,
Toon.
More information about the Gcc-bugs
mailing list