>> On Sun, Oct 12, 2025 at 12:41 PM Jose E. Marchesi
>> <[email protected]> wrote:
>>>
>>> This commit adds a new common command-line option to the compiler
>>> driver (-static-libga68) as well as several other front-end specific
>>> options.
>>>
>>> Signed-off-by: Jose E. Marchesi <[email protected]>
>>
>> LGTM, some bikeshedding below.
>>
>>> gcc/ChangeLog
>>>
>>>         * algol68/lang.opt: New file.
>>>         * algol68/lang.opt.urls: Generate.
>>>         * common.opt: New option -static-libga68.
>>>         * common.opt.urls: Generate.
>>>         * gcc.cc: Handle OPT_static_libga68.
>>>         * regenerate-opt-urls.py (PER_LANGUAGE_OPTION_INDEXES): Add Algol68.
>>> ---
>>>  gcc/algol68/lang.opt       | 122 +++++++++++++++++++++++++++++++++++++
>>>  gcc/algol68/lang.opt.urls  |  41 +++++++++++++
>>>  gcc/common.opt             |   3 +
>>>  gcc/common.opt.urls        |   3 +
>>>  gcc/gcc.cc                 |   2 +
>>>  gcc/regenerate-opt-urls.py |   3 +-
>>>  6 files changed, 173 insertions(+), 1 deletion(-)
>>>  create mode 100644 gcc/algol68/lang.opt
>>>  create mode 100644 gcc/algol68/lang.opt.urls
>>>
>>> diff --git a/gcc/algol68/lang.opt b/gcc/algol68/lang.opt
>>> new file mode 100644
>>> index 00000000000..bbc0a06a530
>>> --- /dev/null
>>> +++ b/gcc/algol68/lang.opt
>>> @@ -0,0 +1,122 @@
>>> +; Options for the Algol 68 front end.
>>> +; Copyright (C) 2025 Free Software Foundation, Inc.
>>> +;
>>> +; GCC is free software; you can redistribute it and/or modify it under
>>> +; the terms of the GNU General Public License as published by the Free
>>> +; Software Foundation; either version 3, or (at your option) any later
>>> +; version.
>>> +;
>>> +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
>>> +; WARRANTY; without even the implied warranty of MERCHANTABILITY or
>>> +; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
>>> +; for more details.
>>> +;
>>> +; You should have received a copy of the GNU General Public License
>>> +; along with GCC; see the file COPYING3.  If not see
>>> +; <http://www.gnu.org/licenses/>.
>>> +
>>> +; See the GCC internals manual for a description of this file's format.
>>> +
>>> +; Please try to keep this file in ASCII collating order.
>>> +
>>> +; Describes command-line options used by this frontend
>>> +
>>> +Language
>>> +Algol68
>>> +
>>> +I
>>> +Algol68 Joined Separate
>>> +; Documented in c-family/c.opt
>>> +
>>> +Wextensions
>>> +Algol68 Warning Var(warn_algol68_extensions) LangEnabledBy(Algol68, Wextra)
>>> +Warn for usage of non-portable extensions of Algol 68.
>>> +
>>> +Wvoiding
>>> +Algol68 Warning Var(warn_algol68_voiding) LangEnabledBy(Algol68, Wextra)
>>> +Warn when voiding occurs.
>>> +
>>> +Wextra
>>> +Algol68 Warning
>>> +; Documented in common.opt
>>> +
>>> +Wscope
>>> +Algol68 Warning Var(warn_algol68_scope)
>>> +Warn for potential name scope violations.
>>> +
>>> +Whidden-declarations
>>> +Algol68 Warning Var(warn_algol68_hidden_declarations)
>>> +Warn for hidden declarations in inner scopes.
>>> +
>>> +fa68-safe
>>> +Algol68 Var(flag_a68_safe)
>>> +-fa68-safe             Compile code only known to be memory safe.
>>> +
>>> +fa68-safe-bounds
>>> +Algol68 Var(flag_a68_safe_bounds)
>>> +-fa68-safe-bounds      Error out if not all bounds are known to be legal.
>>> +
>>
>> Since users know they are working with algol68, is prefixing
>> with 'a68-' really necessary?  I don't think there's precedence for this
>> in other frontends.
>
> It isn't necessary, and in fact it is much better without the prefix.
>
> Will change the backend to _consistently_ use options with no prefix of
> any kind.

There is a difficulty.

Removing the a68- prefix from the front-end specific options causes two
collisions with options also defined by the D front-end:

  -fassert
  -fdebug

Facing this, the current infrastructure causes cpp errors in the
generated options.cc due to differences in the help strings:

  #error Multiple different help strings for fassert:
  #error   Generate code for ASSERT constructs.
  #error   Generate code for assert contracts.
  #error Multiple different help strings for fdebug:
  #error   -fdebug              Enable debugging traces of the Algol 68 front 
end.
  #error   Compile in debug code.

As Ian has mentioned, the Rust and Go front-ends consistently use
-frust- and -fgo- prefixes respectively.

So at this point I would be inclined to continue using the -fa68-
prefixes, the alternative being to move these options to common.opt and
come with generic enough help strings.

WDYT?

> Thanks!
>
>>> +fa68-brackets
>>> +Algol68 Var(flag_a68_brackets)
>>> +-fa68-brackets         Consider [ .. ] and { .. } as being equivalent to ( 
>>> .. ).
>>> +
>>> +fa68-debug
>>> +Algol68 Var(flag_a68_debug)
>>> +-fa68-debug            Enable debugging traces of the Algol 68 front end.
>>> +
>>> +fa68-portcheck
>>> +Algol68 Var(flag_a68_portcheck)
>>> +-fa68-portcheck         Emit portability warnings.
>>> +
>>> +fa68-assert
>>> +Algol68 Var(flag_a68_assert)
>>> +Generate code for ASSERT constructs.
>>> +
>>> +fa68-nil-checking
>>> +Algol68 Var(flag_a68_nil_checking)
>>> +Generate code to perform NIL checking while dereferencing.
>>> +
>>> +fa68-bounds-checking
>>> +Algol68 Var(flag_a68_bounds_checking)
>>> +Generate code to perform run-time bounds checking on array accesses.
>>> +
>>> +fdump-algol68-modes
>>
>> ... and here we're using 'algol68' instead of 'a68'.
>>
>>> +Algol68 Var(flag_dump_algol68_modes)
>>> +Dump Algol 68 modes after parsing.
>>> +
>>> +fdump-algol68-tree
>>> +Algol68 Var(flag_dump_algol68_tree)
>>> +Dump Algol 68 parse tree after parsing.
>>> +
>>> +static-libga68
>>> +Driver
>>> +Link the GNU Algol run-time library statically in the compilation.
>>> +
>>> +shared-libga68
>>> +Driver
>>> +Link the GNU Algol 68 run-time library dynamically in the compilation.
>>> +
>>> +std=algol68
>>> +Algol68
>>> +Conform to the Algol 68 Revised Report
>>> +
>>> +std=gnu68
>>> +Algol68
>>> +Accept GNU extensions to Algol 68
>>> +
>>> +; Stropping regimes.
>>> +
>>> +fstropping=
>>> +Algol68 Joined RejectNegative Enum(stropping_regime) 
>>> Var(flag_stropping_regime)
>>> +-fstropping=[upper|supper]              Stropping regime to expect in 
>>> Algol 68 programs.
>>
>> and this is without a 'a68-' prefix.
>>
>> Richard.
>>
>>> +
>>> +Enum
>>> +Name(stropping_regime) Type(int) UnknownError(unknown stropping_regime 
>>> setting %qs)
>>> +
>>> +EnumValue
>>> +Enum(stropping_regime) String(upper) Value(0)
>>> +
>>> +EnumValue
>>> +Enum(stropping_regime) String(supper) Value(1)
>>> +
>>> +; This comment is to ensure we retain the blank line above.
>>> diff --git a/gcc/algol68/lang.opt.urls b/gcc/algol68/lang.opt.urls
>>> new file mode 100644
>>> index 00000000000..3eb2fd0cc61
>>> --- /dev/null
>>> +++ b/gcc/algol68/lang.opt.urls
>>> @@ -0,0 +1,41 @@
>>> +; Autogenerated by regenerate-opt-urls.py from gcc/algol68/lang.opt and 
>>> generated HTML
>>> +
>>> +I
>>> +UrlSuffix(gcc/Directory-Options.html#index-I) 
>>> LangUrlSuffix_D(gdc/Directory-Options.html#index-I) 
>>> LangUrlSuffix_Algol68(ga68/Directory-options.html#index-I)
>>> +
>>> +Wextensions
>>> +LangUrlSuffix_Algol68(ga68/Warnings-options.html#index-Wextensions)
>>> +
>>> +Wvoiding
>>> +LangUrlSuffix_Algol68(ga68/Warnings-options.html#index-Wno-voiding)
>>> +
>>> +Wextra
>>> +UrlSuffix(gcc/Warning-Options.html#index-Wextra) 
>>> LangUrlSuffix_D(gdc/Warnings.html#index-Wextra) 
>>> LangUrlSuffix_Fortran(gfortran/Error-and-Warning-Options.html#index-Wextra)
>>> +
>>> +Wscope
>>> +LangUrlSuffix_Algol68(ga68/Warnings-options.html#index-Wno-scope)
>>> +
>>> +Whidden-declarations
>>> +LangUrlSuffix_Algol68(ga68/Warnings-options.html#index-Whidden-declarations)
>>> +
>>> +fa68-assert
>>> +LangUrlSuffix_Algol68(ga68/Runtime-options.html#index-fa68-assert)
>>> +
>>> +fa68-nil-checking
>>> +LangUrlSuffix_Algol68(ga68/Runtime-options.html#index-fa68-nil-checking)
>>> +
>>> +fa68-bounds-checking
>>> +LangUrlSuffix_Algol68(ga68/Runtime-options.html#index-fa68-bounds-checking)
>>> +
>>> +fdump-algol68-modes
>>> +LangUrlSuffix_Algol68(ga68/Developer-options.html#index-fdump-algol68-modes)
>>> +
>>> +fdump-algol68-tree
>>> +LangUrlSuffix_Algol68(ga68/Developer-options.html#index-fdump-algol68-tree)
>>> +
>>> +static-libga68
>>> +LangUrlSuffix_Algol68(ga68/Linking-options.html#index-static-libga68)
>>> +
>>> +shared-libga68
>>> +LangUrlSuffix_Algol68(ga68/Linking-options.html#index-shared-libga68)
>>> +
>>> diff --git a/gcc/common.opt b/gcc/common.opt
>>> index 6c993a8a6d3..cb69b07cab9 100644
>>> --- a/gcc/common.opt
>>> +++ b/gcc/common.opt
>>> @@ -3964,6 +3964,9 @@ Driver Joined
>>>  static
>>>  Driver
>>>
>>> +static-libga68
>>> +Driver
>>> +
>>>  static-libgcc
>>>  Driver
>>>
>>> diff --git a/gcc/common.opt.urls b/gcc/common.opt.urls
>>> index ab6b4316df9..4619aac2855 100644
>>> --- a/gcc/common.opt.urls
>>> +++ b/gcc/common.opt.urls
>>> @@ -1931,6 +1931,9 @@ UrlSuffix(gcc/Overall-Options.html#index-specs)
>>>  ;   duplicate: 'gcc/Darwin-Options.html#index-static-1'
>>>  ;   duplicate: 'gcc/Link-Options.html#index-static'
>>>
>>> +static-libga68
>>> +LangUrlSuffix_Algol68(ga68/Linking-options.html#index-static-libga68)
>>> +
>>>  static-libgcc
>>>  UrlSuffix(gcc/Link-Options.html#index-static-libgcc)
>>>
>>> diff --git a/gcc/gcc.cc b/gcc/gcc.cc
>>> index eae7f07d962..540958de797 100644
>>> --- a/gcc/gcc.cc
>>> +++ b/gcc/gcc.cc
>>> @@ -4645,11 +4645,13 @@ driver_handle_option (struct gcc_options *opts,
>>>      case OPT_static_libgfortran:
>>>      case OPT_static_libquadmath:
>>>      case OPT_static_libphobos:
>>> +    case OPT_static_libga68:
>>>      case OPT_static_libgm2:
>>>      case OPT_static_libstdc__:
>>>        /* These are always valid; gcc.cc itself understands the first two
>>>          gfortranspec.cc understands -static-libgfortran,
>>>          libgfortran.spec handles -static-libquadmath,
>>> +        a68spec.cc understands -static-libga68,
>>>          d-spec.cc understands -static-libphobos,
>>>          gm2spec.cc understands -static-libgm2,
>>>          and g++spec.cc understands -static-libstdc++.  */
>>> diff --git a/gcc/regenerate-opt-urls.py b/gcc/regenerate-opt-urls.py
>>> index 2daa1d603f0..bda91905ace 100755
>>> --- a/gcc/regenerate-opt-urls.py
>>> +++ b/gcc/regenerate-opt-urls.py
>>> @@ -361,7 +361,8 @@ def write_url_file(index, optfile, dstfile):
>>>  PER_LANGUAGE_OPTION_INDEXES = [
>>>      ('gcc/Option-Index.html', None),
>>>      ('gdc/Option-Index.html', 'D'),
>>> -    ('gfortran/Option-Index.html', 'Fortran')
>>> +    ('gfortran/Option-Index.html', 'Fortran'),
>>> +    ('ga68/Option-Index.html', 'Algol68'),
>>>  ]
>>>
>>>  def main(args):
>>> --
>>> 2.30.2
>>>

Reply via email to