Linux Learning Log (Basic)----VIM last line mode (supplemental), GCC related __linux

Source: Internet
Author: User
    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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.