JM233333's Blog
  • Programming Languages

    • C
    • UNIX-C
    • Python
  • Algorithms and Data Structures

    • Data Structure
    • Fundamental Algorithms
    • Graph Theory
  • GNU Toolchain

    • Bash
    • gdb
  • Development Environment

    • Ubuntu
    • QEMU
  • Development Tools

    • Git
    • VSCode
  • Operating Systems

    • Principles of Operating Systems
    • Xv6
    • Linux Kernel
  • Software Testing and Analysis

    • Software Testing
    • Software Analysis
    • Program Verification
  • LeetCode
  • XJTUOJ
  • Programming

    • Is Parallel Programming Hard
  • System

    • System Performance
  • Others

    • ...
  • Paper Reading

    • Model Checking
    • Fuzzing
    • Symbolic Execution
  • 3D Game Programming

    • 3D Mathematics
  • Miscellaneous

JM233333

弱小可怜又无助的学术废物
  • Programming Languages

    • C
    • UNIX-C
    • Python
  • Algorithms and Data Structures

    • Data Structure
    • Fundamental Algorithms
    • Graph Theory
  • GNU Toolchain

    • Bash
    • gdb
  • Development Environment

    • Ubuntu
    • QEMU
  • Development Tools

    • Git
    • VSCode
  • Operating Systems

    • Principles of Operating Systems
    • Xv6
    • Linux Kernel
  • Software Testing and Analysis

    • Software Testing
    • Software Analysis
    • Program Verification
  • LeetCode
  • XJTUOJ
  • Programming

    • Is Parallel Programming Hard
  • System

    • System Performance
  • Others

    • ...
  • Paper Reading

    • Model Checking
    • Fuzzing
    • Symbolic Execution
  • 3D Game Programming

    • 3D Mathematics
  • Miscellaneous
  • c

  • unix-c

    • UNIX-C 00 - Introduction
    • UNIX-C 88 - GCC Inline Assembly (unfinished)
    • UNIX-C 88 - Introduction to GCC Extensions (unfinished)
      • 前置知识
      • 前言
  • cpp

  • java

  • python

  • programming-languages
  • unix-c
JM233333
2022-09-01
359
2

UNIX-C 88 - Introduction to GCC Extensions (unfinished)

Creative Commons

# 前置知识

本文内容相对较为深入,在阅读本文档前,建议你先阅读我的其它所有非进阶文档,详见 C 语言栏目。

请注意:本文是面向进阶读者的,在阅读本文档前,请确保你已经具备了较为完整的 C 语言基础。


# 前言

GCC 扩展指的是由 GNU C 提供的、原本 ISO C 标准中没有的语言特性,它们丰富了 C 语言的功能,为程序员提供了更多便捷,但是这些特性仅在最广泛使用的 C 编译器 GCC 中有效。甚至,有些我们平时已经用惯了的语法,实际上都是 GCC 扩展的一部分。

  • 注:GCC 官方文档把使用其独有方式实现 C 标准要求的行为也认为是 C 扩展。本文不把这部分内容算作是 C 扩展,而只囊括那些标准 C 没有的语法特性,还请注意。

可以通过检查宏 __GNUC__ 是否被定义来判断 GCC 扩展是否可用,也可以使用编译选项 -pedantic 来指示 GCC 对使用了 GCC 扩展的程序输出警告消息。

#ifdef __GNUC__
// ...
#endif

在 C 语言栏目中,编号 101010 以上的文章专用于介绍各种 GCC 扩展。


#进阶教程#编程语言#C#UNIX#GCC 扩展

← UNIX-C 88 - GCC Inline Assembly (unfinished) Python 00 - Introduction→

最近更新
01
Reading Papers - Kernel Concurrency
06-01
02
Linux Kernel - Source Code Overview
05-01
03
Linux Kernel - Per-CPU Storage
05-01
更多文章>
Theme by Vdoing | Copyright © 2019-2023 JM233333 | CC BY-NC-SA 4.0
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式