> Fixed-form, known as "reference format", is still more-or-less
> required by IBM.  Forced in gcobol with the option "-ffixed-form".
> Can be controlled inside a source code file with the compiler
> directive ">> SOURCE FORMAT IS FREE"
>
> Columns 1-6  ignored
> Column    7  * for comment, - for continuation, and a few other
> special things
> Column    8  Area A -- labels started here
> Column   12  Area B -- statements go here
> Column   73 and beyond are ignored
>
> Free-form, is much more forgiving.  Forced with "-ffree-form", or from
> inside the program with ">> SOURCE FORMAT IS FIXED"
>
> There is no line limit in free form; the entire program could fit on a
> single line.
>
> GCOBOL uses a heuristic when the format is unspecified.  It looks at
> first line of source code.  If the first six characters are digits or
> blanks, it switches to "extended reference format", where the first
> six characters are ignored, column seven is the indicator column, *>
> comments can start anywhere, and there is no line length limit.


This gives three reference-formats: "fixed" "free" and "extended". For
two of those we have seen the flags -ffixed-form and -ffree-form, so I'd
_guess_ the last one would be -fextended-form.

Question: Is there a reason to have multiple flags for that? We dropped
this in GnuCOBOL, finding that there are even more reference formats and
use now a single one:

-fformat=fixed/free/extended/.../auto

I'd like to suggest to drop those current three flags to one flag for
choosing the reference-format with a value telling the frontend which
one to use.


Side-note: auto-choosing "extended" was at least confusing for me (and
the NIST suite initial compile-try). That likely confused me most,
because of not knowing another compiler choosing _that_ format
automatically.
I'd recommend to choose "fixed" if there are line numbers recognized,
but much more, I'd suggest to move from multiple format flags to a
single one.

Simon

Reply via email to