I have a large codebase that I’ve been tasked with porting to 64 bits. The code compiles, but it prints a very large amount of incompatible pointer warnings (as is to be expected.) Is there any way I can have gcc print the line on which the error occurs? At this point I’m just using gcc’s error messages to try to track down assumptions that need to be modified, and having to look up every one is not fun.
Share
I’ve blatantly stolen Joseph Quinsey’s answer for this. The only difference is I’ve attempted to make the code easier to understand:
For bash, use
make 2>&1 | show_gcc_linewithshow_gcc_linethe following script:This was partly because I did not like the formatting of the original. This only prints the warnings/errors, followed by the line of code causing the problem, followed by a blank line. I’ve removed the string of hyphens too.