From 5f05e954ee1f1daf953b3ff20af81775f226d5bf Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 28 Aug 2016 18:12:03 -0700 Subject: 3273 Undo 3272. The trouble with creating a new section for constants is that there's no good place to order it since constants can be initialized using globals as well as vice versa. And I don't want to add constraints disallowing either side. Instead, a new plan: always declare constants in the Globals section using 'extern const' rather than just 'const', since otherwise constants implicitly have internal linkage (http://stackoverflow.com/questions/14894698/why-does-extern-const-int-n-not-work-as-expected) --- 085scenario_console.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '085scenario_console.cc') diff --git a/085scenario_console.cc b/085scenario_console.cc index 6dc825e1..b4e41699 100644 --- a/085scenario_console.cc +++ b/085scenario_console.cc @@ -33,8 +33,8 @@ scenario keyboard-in-scenario [ ] ] -:(before "End Fixed Scenario Locations") -const int CONSOLE = Next_predefined_global_for_scenarios++; +:(before "End Scenario Globals") +extern const int CONSOLE = Next_predefined_global_for_scenarios++; //: give 'console' a fixed location in scenarios :(before "End Special Scenario Variable Names(r)") Name[r]["console"] = CONSOLE; -- cgit 1.4.1-2-gfad0