From 5572b1e88378888d0b1dbe9fea7a650e4af2c0b6 Mon Sep 17 00:00:00 2001 From: Andrew Plotkin Date: Sun, 26 Jun 2022 10:45:11 -0400 Subject: [PATCH 1/2] Deprecation warning for the Version directive. --- directs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/directs.c b/directs.c index 111296f8..19c48639 100644 --- a/directs.c +++ b/directs.c @@ -1143,6 +1143,7 @@ the first constant definition"); { error("The version number must be in the range 3 to 8"); break; } + obsolete_warning("the Version directive is deprecated and may produce incorrect results. Use -vN instead, as either a command-line argument or a header comment."); select_version(i); /* We must now do a small dance to reset the DICT_ENTRY_BYTES constant, which was defined at startup based on the Z-code From 5a73d02088a4b660fcf86c7c955d058d1357c3a2 Mon Sep 17 00:00:00 2001 From: Andrew Plotkin Date: Sun, 26 Jun 2022 10:51:22 -0400 Subject: [PATCH 2/2] Deprecation warning for the Switches directive. Also error if you do Switches after a routine definition. --- directs.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/directs.c b/directs.c index 19c48639..11a99e48 100644 --- a/directs.c +++ b/directs.c @@ -927,9 +927,18 @@ Fake_Action directives to a point after the inclusion of \"Parser\".)"); if (token_type != DQ_TT) return ebf_error_recover("string of switches", token_text); if (!ignore_switches_switch) - { if (constant_made_yet) - error("A 'Switches' directive must must come before \ -the first constant definition"); + { + if (constant_made_yet) { + error("A 'Switches' directive must must come before the first constant definition"); + break; + } + if (no_routines > 1) + { + /* The built-in Main__ routine is number zero. */ + error("A 'Switches' directive must come before the first routine definition."); + break; + } + obsolete_warning("the Switches directive is deprecated and may produce incorrect results. Use command-line arguments or header comments."); switches(token_text, 0); /* see "inform.c" */ } break;