title: problems compiling and running Nachos
body: <p>First issue: I am trying to import stdlib.h in order to use functions like malloc() and rand(). I am working in threadtest.cc  , folder threads. This is the error I get after </p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  
  In file included from ../threads/threadtest.cc:18:0:
  /usr/include/stdlib.h:146:33: error: declaration of ‘double atof(const char*) throw ()’ has a different exception specifier
  In file included from ../threads/utility.h:57:0,
               from ../threads/system.h:12,
               from ../threads/threadtest.cc:13:
  ../machine/sysdep.h:62:8: error: from previous declaration ‘double atof(const char*)’
  In file included from ../threads/threadtest.cc:18:0:
  /usr/include/stdlib.h:149:33: error: declaration of ‘int atoi(const char*) throw ()’ has a different exception specifier
  In file included from ../threads/utility.h:57:0,
               from ../threads/system.h:12,
               from ../threads/threadtest.cc:13:
  ../machine/sysdep.h:61:5: error: from previous declaration ‘int atoi(const char*)’
  In file included from ../threads/threadtest.cc:18:0:
  /usr/include/stdlib.h:771:60: error: declaration of ‘int abs(int) throw ()’ has a different exception specifier
  In file included from ../threads/utility.h:57:0,
               from ../threads/system.h:12,
               from ../threads/threadtest.cc:13:
  ../machine/sysdep.h:63:5: error: from previous declaration ‘int abs(int)’
  ../threads/threadtest.cc: In function ‘void shout(int)’:
  ../threads/threadtest.cc:83:25: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
  </code></pre>
  
  <p>What can be a reason for this?</p>
  
  <p>Second issue: I am trying to give a forked new thread a name. </p>
  
  <pre><code>Thread * t = new Thread ("my id");
  t-&gt;Fork(shout, S);
  </code></pre>
  
  <p>And testing it in function shout:</p>
  
  <pre><code>printf ("%s", currentThread-&gt;getName());
  </code></pre>
  
  <p>This example works fine.
  However, if I want to give the thread a "dynamic" id, I use:</p>
  
  <pre><code>sprintf(id, "%d", i);
  Thread * t = new Thread (id);
  </code></pre>
  
  <p>With the same printf for currentThread->getName() it gets me junk:</p>
  
  <p>x�ӿ����_    ��� </p>
  
  <p>I have used example from the Nachos documentation as well as tried different ways to transmit a dynamic id using string functions, but nothing worked, only junk.</p>
  
  <p>Thank you for any answers.</p>