0

I am writing a gcc wrapper that will invoke gcc on my source file with the -Wall compile flag set. If there is no errors or warnings, it will execute the output binary.

The exit status off gcc will be 1 if there is a error. But it will be zero even if there is a warning.

So how do I detect if gcc produced any warnings in my shell script?

1 Answer 1

1

The easiest way is to add to the gcc command the option -Werror which makes all warnings into errors.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .