Setting gcc Alias
In this course you need to compile code using gcc and a set of options.
Instead of having to type those options every time, linux allows you to
create an alias. The steps to create an alias are:
-
Go to your home directory in grace. Remember that executing cd
will take you to your home directory.
-
In your home directory open (or create if it does not exist) a file
called .aliases (the filename has a period
at the beginning.)
-
Add the following line to the .aliases file and make sure you add a
blank line after it.
alias gcc "gcc -ansi -Wall -g -O0 -Wwrite-strings -Wshadow -pedantic-errors -fstack-protector-all -Wextra"
-
Log out and then log on again.
-
You can verify the alias has been set correctly if you execute alias gcc
and you see the following:
gcc -ansi -Wall -g -O0 -Wwrite-strings -Wshadow -pedantic-errors -fstack-protector-all -Wextra
-
If you have problems you can also cut and paste the command from the file
gcc_aliases_info.txt that will your find in the info directory of the
grace public directory.
Web Accessibility