How to get gcc to skip errors, but still output them.

后端 未结 3 2026
长情又很酷
长情又很酷 2021-01-18 12:31

is it possible to force gcc to report errors, but keep compiling past them? Essentially I\'m trying to generate a list of errors in a .c file, but gcc always terminates at t

3条回答
  •  后悔当初
    2021-01-18 12:58

    Up-to-date versions of GCC will attempt to skip certain errors where possible.

    Say the body of foo(){... contains a const-violation. The translation unit will not produce an object file but any decent compiler will continue past this error into bar(){...

    Other errors are unrecoverable. If you miss out some curly braces there's no reasonable guess that can be mades as to how to proceed.

提交回复
热议问题