[comp.lang.ada] more silly portablity problems

arny@cbnewsl.att.com (arny.b.engelson) (05/26/90)

Aside from the Ada portability concerns I'm used to dealing with, such as
Integer and Float type differences, rep specs, etc., I ran into an unexpected
one the other day.

I received something close to 20_000 lines of Ada source code from someone,
which I believe had been compiled under Alsys.  When I attempted to compile
it under DEC's compiler, I discovered (to my disappointment) that the
compiler limits the input line length to 120 characters and the source code
contained many lines (hundreds I think) over this limit.  The compiler
simply ignored everything beyond column 120 (it did print an error message).

I don't mention this to fault the compiler or the source code (although
personally I find line lengths > 80 columns to be most annoying during those
times I am stuck with an 80 column terminal or printer).  This just seemed to
be an interesting portability concern.  Fits in with the maximum length of
identifier names problem which can be much more cumbersome to fix (like after
you globally shorten the name and find out it is now equal to some other name).
The situation was easy to fix (my choice was to write a quick program that
splits the line at the last token prior to column 120), but still something
we should be aware of when writing code, pretty printers not withstanding.

P.S. In case anyone cares, the code was CADRE's Ada binding to their Teamwork/
Access routines. (CADRE Teamwork is a CASE tool, for those unfamiliar with it)

  -- Arny Engelson   att!wayback!arny

kassover@jupiter.crd.ge.com (David Kassover) (05/29/90)

In article <1990May25.171457.26472@cbnewsl.att.com> arny@cbnewsl.att.com (arny.b.engelson) writes:
...
>I received something close to 20_000 lines of Ada source code from someone,
>which I believe had been compiled under Alsys.  When I attempted to compile
>it under DEC's compiler, I discovered (to my disappointment) that the
>compiler limits the input line length to 120 characters and the source code
>contained many lines (hundreds I think) over this limit.  The compiler
>simply ignored everything beyond column 120 (it did print an error message).

In section F.9.5  Implementation limits, the VAX Ada reference
manual (February 1985) shows 120 as the maximum number of
characters in a source line.

The entire Appendix F in this manual is printed in a color other
than black, which is Digital's convention for non-standard or
ad-libertem features.

I suppose it would have been nice if Digital had provided a
pragma that could change this limit on a compilation by
compilation basis.  Perhaps they just haven't got to it yet.

(Here at the Control Systems Laboratory in CRD, we have not
gotten to version 2.x of the Ada compiler yet, for compatibility
with our end-users reasons.  I don't know how much of the world
will change when we do so)


I, myself, use a editing window (for Ada code) that is 100
columns wide.  I find that this is a reasonable compromise
between 120 characters (max the compiler will allow) and 80
characters, which would necessitate many more lines of code (we
have long identifiers here)

We have no formal coding style specification here, and so far
individual variations have caused no real problems among us.
--
David Kassover             "Proper technique helps protect you against
kassover@ra.crd.ge.com	    sharp weapons and dull judges."
kassover@crd.ge.com			F. Collins