In VARIABLES.CSV, RETAIN variable were only flagged as such for GLOBALS, now local POU variable shoud be as well.
authorEdouard Tisserant
Fri, 22 Jul 2022 09:24:12 +0200
changeset 1099 cdb045e8be20
parent 1098 84bbafb4fb26
child 1100 f7cc4f6ce756
child 1101 f7a0e962650d
In VARIABLES.CSV, RETAIN variable were only flagged as such for GLOBALS, now local POU variable shoud be as well.
stage4/generate_c/generate_var_list.cc
--- a/stage4/generate_c/generate_var_list.cc	Tue Feb 15 10:34:23 2022 +0100
+++ b/stage4/generate_c/generate_var_list.cc	Fri Jul 22 09:24:12 2022 +0200
@@ -481,6 +481,7 @@
     /*  VAR RETAIN var_init_decl_list END_VAR */
     void *visit(retentive_var_declarations_c *symbol) {
       unsigned int was_retain = is_retain;
+      is_retain = 1;
       symbol->var_init_decl_list->accept(*this);
       is_retain = was_retain;
       return NULL;