title: How to check syntax correctness of a C code programmatically?
body: <p>I'm working on a software plagiarism detection method for C source files. To do that, I made a program to simplify the syntax of source codes, like making all variable names same and making all loop types same. Obviously, I can't do this on the codes which have not proper syntax (therefore cannot be compiled).</p>
  
  <p>There is a GCC command to see syntax problems on a C source code: <code>gcc -c -fsyntax-only assignment1.c</code>. This command prints <code>assignment1.c</code> code with some weird lines and syntax problems (if exists). But I need like a boolean output, just specify if the code written properly or not. Is there a command for this? Or how can I use <code>-fsyntax-only</code> command for this purpose? (By the way, I don't want to compile codes, all I need is check their syntaxes.)</p>
  
  <p>edit: I think I'm misunderstood. I need to read C source files and then check their syntaxes programmatically. So I should use the output of command <code>gcc -c -fsyntax-only assignment1.c</code> in the program I created.</p>