Klaus Ramstoeck wrote:
> Is there a list of compiler glitches /bad coding practice
> maintained somewhere? I recently switched compilers and ran
> into more trouble than expected.
> The following code snippet explains the idea:
> --snip
> select case (problem)
> ! Add special cases later
> case default
> call works_always_but_slow
> end select
> --snip
> Whereas the first compiler accepted it without warnings
> in strict f90 mode, the second one failed.
>
> I don't want to bitch about this or that vendor, I want to
> learn about good&safe coding practice.
Since the F90/F95 standard clearly indicates that case-stmt-blocks are
optional (you may have zero or more), it would be a bug if a compiler were
to report absence of a non-default case block as a standards violation. Any
reputable compiler vendor would welcome a bug report on this or any other
problem of this nature.
Standards checking is an area many compilers are likely to have problems
with in some area or other. In some cases, the implementors may have
misread text in the standard, in others they didn't think to add a check for
a particular constraint. I know that we're still finding holes in our
standards checking (though this isn't one of them.) While it's easier to
test that standard-conforming programs DON'T get warnings than that
non-conforming programs DO, the lack of a comprehensive and official F90/F95
standards testing suite makes the implementor's job more difficult in this
area. Independent developers are coming up with suites of tests, some of
which are very good, but F95 is a BIG language and there is not (and doesn't
seem there will ever be) an "official" suite corresponding to the NIST suite
formerly used for FORTRAN 77.
I don't see much point in an independently maintained "glitch" list - such a
list would be dependent on compiler version and would rapidly go out of
date. Good coding practice is something else entirely - one of the things I
like about Stephen Chapman's books on Fortran 90/95 (see
http://www.digital.com/fortran/books.html for pointers) is that they stress
good programming practice over and above "correct" use of the language.
Steve Lionel mailto:[log in to unmask]
DIGITAL Fortran Development http://www.digital.com/info/slionel.html
Compaq Computer Corporation
110 Spit Brook Road, ZKO2-3/N30
Nashua, NH 03062-2698 "Free advice is worth every cent"
DIGITAL Fortran web site: http://www.digital.com/fortran
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|