[12/12] Constify ada-lex.l:attributes

Message ID 20240321-ada-iterated-assign-v1-12-925cdd4f1f4a@adacore.com
State New
Headers
Series Ada iterated assignment, plus parser cleanups |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Tom Tromey March 21, 2024, 7:03 p.m. UTC
  While examining the Ada parser globals with 'nm', I noticed that the
lexer's "attributes" array should be const.  This change moves it into
read-only storage.
---
 gdb/ada-lex.l | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l
index 4e99eaab036..1b1aaf89005 100644
--- a/gdb/ada-lex.l
+++ b/gdb/ada-lex.l
@@ -662,7 +662,7 @@  subseqMatch (const char *subseq, const char *str)
 }
 
 
-static struct { const char *name; int code; }
+static const struct { const char *name; int code; }
 attributes[] = {
   { "address", TICK_ADDRESS },
   { "unchecked_access", TICK_ACCESS },