1

I have a source code of C-project that has more than 600 c-files in it and it compiles for ARM mcu using GCC toolchain. I wonder how can I make a closest guess about which of the C standard this c-project is compliant to among C99, C11 and C17?

Marina
  • 13
  • 4
  • 8
    Start with `-std=c89` as arguments for GCC and work your way up until it successfully builds. https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html – sneusse Jan 18 '22 at 09:31
  • 1
    What compiler options were used for GCC when compiling for ARM? Look for `-std=xx` – Gerhardh Jan 18 '22 at 09:33
  • 1
    Chances are, the code uses GNU extensions, so it's not actually any of those. So try adding `-pedantic` to compiler options. – hyde Jan 18 '22 at 09:38
  • Also, if the code is not initially warning free, you are going to have a bad time with it, most likely. – hyde Jan 18 '22 at 09:39
  • Guessing is not an appropriate technique for software development. – Eric Postpischil Jan 18 '22 at 11:37
  • 600 c files and no documentation or hints of how to build it? Then abandon this project as early on as possible... – Lundin Jan 18 '22 at 15:35

0 Answers0