6, Vim profile User level: ~/.VIMRC (hidden, directly created) system level/ETC/VIM/VIMRC
Use vim--version to view details GCC related (emphasis) 1, GCC workflow GCC calls other processors to complete the process preprocessing-e (using preprocessor CPP) macro substitution
Header file Expand comment Remove xxx.c into xxx.i xxx.i or c file compilation-S (compilation is the most time-consuming, compiler GCC) Turning the xxx.i into a xxx.s xxx.s assembly file-C (assembler as) turns XXX.S into XXX.O XXX.O is binary file link (connector ld) XXX.O--> xxx (executable) (under win Exe,linux down) 2, gcc commonly used parameters (2~4 key to grasp the parameters) 1, view board this information Gcc-v/--version 2, at compile time specify the path of header file-i gcc sum.c-i./include/-o sum sum.c file
has a custom Head.h header file, but not in the current directory, you need-I to specify path 3 of the header file and generate the assembly file. o binary file-c gcc sum.c-c-I./include/ Generates a SUM.O file in the current directory to use the file command to view the format of the file SUM.O result: SUM.O: ELF 64-bit LSB RelocataBLE, x86-64, version 1 (SYSV), not stripped file sum.c result: sum.c:c source, UTF -8 Unicode text 4, specify filename for makefile-o gcc hello.c-o name 5, gdb Debug-G 6, at compile time Specifies that a macro-D gcc sum.c-i./include/-D debug does not exist in SUM.C, so you need to use the-D parameter to specify at compile time
It is useful to debug code, for example, when developing a program, a lot of intermediate information needs to be output, and for such a printf statement you can write a sentence on it #ifdef DEBUG
If debug is specified at compile time, the printf statement executes, and if not specified, the statements are deleted (equivalent to comments) 7, warning message-wall
hql@hql-virtual-machine:~/Desktop $ gcc sum.c-i./include/-D debug-o app-wall sum.c:in function ' main ':
sum.c:9:9:warning:unused variable ' AA ' [-wunused-variable] int aa; ^ 8, optimized code-on n represents the optimization level: 1, 2, 3 (value range is 1~3) What is code optimization: Thin Code