Modify code generated for avoiding warning while compiling when configuration or resource don't have any global variable
authorlaurent
Fri, 01 Apr 2011 17:26:29 +0200
changeset 255 86ef2244aef1
parent 254 28bd86c56793
child 272 579db02bebd9
Modify code generated for avoiding warning while compiling when configuration or resource don't have any global variable
stage4/generate_c/generate_c.cc
--- a/stage4/generate_c/generate_c.cc	Thu Mar 31 19:11:16 2011 +0200
+++ b/stage4/generate_c/generate_c.cc	Fri Apr 01 17:26:29 2011 +0200
@@ -1051,7 +1051,9 @@
   s4o.print("(void) {\n");
   s4o.indent_right();
   s4o.print(s4o.indent_spaces);
-  s4o.print("BOOL retain = 0;\n");
+  s4o.print("BOOL retain;\n");
+  s4o.print(s4o.indent_spaces);
+  s4o.print("retain = 0;\n");
   
   /* (B.3) Global variables initializations... */
   s4o.print(s4o.indent_spaces);
@@ -1328,7 +1330,9 @@
       s4o.print("(void) {\n");
       s4o.indent_right();
       s4o.print(s4o.indent_spaces);
-      s4o.print("BOOL retain = 0;\n");
+      s4o.print("BOOL retain;\n");
+      s4o.print(s4o.indent_spaces);
+      s4o.print("retain = 0;\n");
       
       /* (B.2) Global variables initialisations... */
       if (current_global_vars != NULL) {