I use M-x compileEmacs to compile my C code, which then initiates make -kand allows me to compile the code. I want to use Clang (or, presumably, GCC 4.8 after installing it) as the default compiler. I have ccaliased up clang -Wall -Werror -std=c99 -ggdb -O0, and although this calls Clangfrom a command line outside of Emacs, the call M-x compilefrom Emacs still seems to be an alias ccin GCC version 4.7, which I installed. I want to use the richer and clearer error and warning messages provided by Clang (and GCC 4.8), but I don’t want to create a separate make-up file for each short student-level program that I am writing, as I am currently viewing K & R, including solving exercises.
How to convince Emacs that M-x compilethey make -kshould call Clang (or GCC 4.8) instead of the old version of GCC?
source
share