Configure GCC to add compile flags globally
问题 Can I configure GCC to add some file globally, for every project? I want to make it temporarily and only with flags like: -fdiagnostics-color . 回答1: I don't understand why do you need it but you can do a wrapper: which gcc - will print a patch to GCC (copy it to clipboard) mkdir somedir; cd somedir create file with name gcc and add into it: full path to gcc(from clipboard) -fdiagnostics-color somefile.c $@ this command will add -fdiagnostics-color somefile.c before every line that came to gcc