From: Jose E. Marchesi Date: Sat, 17 Jan 2026 20:56:20 +0000 (+0100) Subject: a68: add explicative comment to are_packs_equivalent X-Git-Tag: basepoints/gcc-17~1943 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f89e3c8acdc3a0e12aa8eaaec1bc9c67ea6fde98;p=thirdparty%2Fgcc.git a68: add explicative comment to are_packs_equivalent While fixing PR algol68/123653 I noticed that there was a struct mode interned in the compiler with the form `struct (ref int)'. This is odd because fields are supposed to have names in struct modes. Turns out that the culprit is: (void) a68_add_mode_to_pack (&z, M_REF_INT, NO_TEXT, NO_NODE); EQUIVALENT (M_SEMA) = a68_add_mode (&TOP_MOID (&A68_JOB), STRUCT_SYMBOL, a68_count_pack_members (z), NO_NODE, NO_MOID, z); i.e. it is the standard mode `sema'. The report says that it is a struct that hold a reference to int within, but you are not allowed to access it. This patch adds a comment to are_packs_equivalent explaining why the name of a pack may be NULL. Signed-off-by: Jose E. Marchesi gcc/algol68/ChangeLog * a68-parser-moids-equivalence.cc (are_packs_equivalent): Add explicative comment. --- diff --git a/gcc/algol68/a68-parser-moids-equivalence.cc b/gcc/algol68/a68-parser-moids-equivalence.cc index 260eb4209a6..f97dcafc694 100644 --- a/gcc/algol68/a68-parser-moids-equivalence.cc +++ b/gcc/algol68/a68-parser-moids-equivalence.cc @@ -49,6 +49,10 @@ are_packs_equivalent (PACK_T *s, PACK_T *t, return false; if (compare_names) { + /* Note that a name in a pack of a struct may be NULL if the + corresponding field is supposed to not be accessible by the user. + There is at present one instance of this: the standard prelude + */ if (TEXT (s) != TEXT (t) && !(TEXT (s) != NO_TEXT && TEXT (t) != NO_TEXT