title: Can GCC compile and run a source code without generating object or executable files?
body: <p>Can GCC compile and run a source code without generating any output file (neither object nor executable), in a manner that is supported cross-platform? Especially, a solution supported by GCC directly.</p>
  
  <p>I want to avoid generation of any trace file since that is a minor code in a big project. It just messes up the bin directory.</p>
  
  <p>An existing question, <a href="https://stackoverflow.com/questions/26738082/">here</a>, provides a solution for <strong>compiling</strong> source code without generating any output file, such as:</p>
  
  <pre><code>gcc somefile.c -o /dev/null
  </code></pre>
  
  <p>However, this only compiles, and doesn't run.</p>
  
  <p>Another similar question <a href="https://stackoverflow.com/questions/3457040/how-to-write-a-program-in-c-such-that-it-will-delete-itself-after-execution">here</a> provides a solution that is specific to Windows OS, not cross-platform.</p>