* sim/ucsim/cmd.src/newcmd.cc: fixed bug with uninitialized varaibles
[fw/sdcc] / sim / ucsim / cmd.src / newcmd.cc
index fb1053ab6c9128e7b91b065abfaafb1d6266735e..3ba5614bdaf0f370a0d71b7294a2b278ec621e1b 100644 (file)
@@ -782,8 +782,18 @@ cl_commander::init(void)
     add_console(mk_console(port_number_option.get_value((long)0)));
 #endif
 
+  /* The following code is commented out because it produces gcc warnings
+   * newcmd.cc: In member function `virtual int cl_commander::init()':
+   * newcmd.cc:785: warning: 'Config' might be used uninitialized in this function
+   * newcmd.cc:786: warning: 'cn' might be used uninitialized in this function
+   */
+  /*
   char *Config= config_file_option.get_value(Config);
   char *cn= console_on_option.get_value(cn);
+   */
+  /* Here shoud probably be something else, but is still better then the former code... */
+  char *Config= config_file_option.get_value("");
+  char *cn= console_on_option.get_value("");
 
   if (cn)
     {