Issue
I am currently using the following flags for my gcc compiler:
gcc -std=c99 -pedantic -Wall D_DEFAULT_SOURCE -g -c filename.c
But how can I make the output as verbose as possible? The error messages I am getting in C are not as nice as I am used to from more high level languages and I want to get as much information out of the gcc compiler as possible.
Solution
This is a summary of all comments I've received on this post:
- These flags are the best you can use to make your compiler as verbose as
possible:
Other flags such as-pedantic -Wall -Werror -Wextra
-v
and the entire-d*
family will make the compilation process more verbose but won't enhance the error messages you are getting. - Check your current version with
gcc --version
. To get the newest gcc Version (i.e. gcc 12.2 since August 19, 2022) you might have to clone the gcc repository and build it yourself based on the distro (check vialsb_release -d
) you are using.- Check this stackoverflow question out to install gcc 12.2 on Ubuntu.
- Alternatively you could also directly get gcc-11 from apt without upgrading to the latest bleeding edge ubuntu (don't forget to use
gcc-11
instead ofgcc
afterwards to compile).
Answered By - sueszli Answer Checked By - Terry (WPSolving Volunteer)