Skip to content

Repository files navigation

gccf

GCC error formatter

Overview

This script parses the output from GCC's -fdiagnostics-format=sarif-stderr flag and outputs easy-to-read error messages.

Usage

For use as a Linux shell command, make sure that the shebang path at the top of the script points to your Python interpreter's location.

#!/usr/bin/python3

Then just copy the script to your PATH.

$ cp gccf.py ~/.local/bin/gccf

$ gccf -Wall -Wextra -o my_app main.c

See the build_test_files_gccf script for an example of how to import the core function into your own Python script.

Setting max results

As of this time, the GCC flag -fmax-errors=n does not work properly when using -fdiagnostics-format (bug report) so for now set the result_count_max variable at the top of the script if needed.

Development

$ ./build_test_files_gccf
$ ./build_test_files_gcc

About

Easy-to-read GCC error messages

Topics

Resources

Stars

Watchers

Forks

Used by

Contributors

Languages