C Language Standards Supported by GCC (GCC 支持的C语言标准)

证书工具之OpenSSL 1、查看openssl完整版本信息 [root@localhost ~]# openssl version -a OpenSSL 1.0.1e-fips 11 Feb 2013 built on: Mon May 9 09:54:24 CDT 2016 platform: linux-x86_64 options: bn(64,64) md2(int) rc4(16x,int) des(id... 阅读详情

Using the GNU Compiler Collection

Language Standards Supported by GCC

GCC支持的语言标准

For each language compiled by GCC for which there is a standard,

对于由GCC编译的每种语言都有一个标准

GCC attempts to follow one or more versions of that standard,

GCC尝试遵循该标准的一个或多个版本

possibly with some exceptions, and possibly with some extensions.

可能有一些例外,也可能有一些扩展。

2.1 C Language

The original ANSI C standard (X3.159-1989) was ratified in 1989 and published in 1990.

原 ANSI C 标准(X3.159-1989)于1989年获得批准,并在1990年出版。

This standard was ratified as an ISO standard (ISO/IEC 9899:1990) later in 1990.

1990年的晚些时候被批准为ISO标准(ISO/IEC 9899:1990)。

There were no technical differences between these publications, although the sections of the ANSI
standard were renumbered and became clauses in the ISO standard.

这些出版物之间没有技术差异,尽管ANSI的部分标准被重新编号成为 ISO 标准条款。

The ANSI standard, but not the ISO standard, also came with a Rationale document.

但是 ANSI 标准相比于 ISO 标准,还附有一个基本原理的文档。

This standard, in both its forms, is commonly known as C89, or occasionally as C90, from the dates of ratifcation.

这个标准自批准之日起以两种形式存在,通常被称为C89,有时也称为C90

To select this standard in GCC, use one of the options‘-ansi’,‘-std=c90’or‘-std=iso9899:1990’;

要在GCC中选择此标准,可使用选项 '-ansi''-std=c90''-std=iso9899:1990'

to obtain all the diagnostics required by the standard, you should also specify‘-pedantic’
(or‘-pedantic-errors’if you want them to be errors rather than warnings).
See Section 3.4 [Options Controlling C Dialect], page 33.

为了获得该标准所需要的所有诊断信息,
您还应该指定'-pedantic'( 或'-pedantic-errors',如果您希望它们是错误而不是警告 )。
详见3.4节 [ 控制C语言选项 ], 33页

Errors in the 1990 ISO C standard were corrected in two Technical Corrigenda published in 1994 and 1996.
GCC does not support the uncorrected version.

在 1994年 和 1996年, 1990年 ISO C 标准的错误已在两份发布的技术勘误表中得到纠正.
GCC不支持未校正的版本。

An amendment to the 1990 standard was published in 1995.

1995年出版了1990年标准的修正案。

This amendment added digraphs and __STDC_VERSION__ to the language, but otherwise concerned the library.

这个修正案添加了 digraphs 和 __STDC_VERSION__ 到 C 语言中,但是并没有涉及这个库的其他方面

This amendment is commonly known as AMD1; the amended standard is sometimes known as C94 or C95.

这个修正案俗称为 AMD1; 修订后的标准被称为 C94C95

To select this standard in GCC, use the option‘-std=iso9899:199409’(with, as for other standard versions,‘-pedantic’to receive all required diagnostics).

要在GCC中选择此标准,请使用选项'-std=iso9899:199409'(与其他标准版本一样, '-pedantic' 接收所需要的诊断信息)

A new edition of the ISO C standard was published in 1999 as ISO/IEC 9899:1999, and is commonly known as C99.
(While in development, drafts of this standard version were referred to as C9X.)

1999年 ISO C standard 的新版本作为 ISO/IEC 9899:1999 出版,通常被称为 C99
(在开发时,本标准版的草案被称为 C9X)

GCC has substantially complete support for this standard version; see http://gcc.gnu.org/c99status.html for details.

GCC 对此标准的版本基本完全支持; 详见 http://gcc.gnu.org/c99status.html

To select this standard, use‘-std=c99’or‘-std=iso9899:1999’.

要选择此标准,请使用'-std=c99''-std=iso9899:1999'

Errors in the 1999 ISO C standard were corrected in three Technical Corrigenda published in 2001, 2004 and 2007.
GCC does not support the uncorrected version.

在2001、2004和2007年, 1999年ISO C标准的错误已在三份发布的技术勘误表中得到纠正
GCC不支持未校正的版本。

A fourth version of the C standard, known as C11, was published in 2011 as ISO/IEC 9899:2011.
(While in development, drafts of this standard version were referred to as C1X.)

2011年 C标准的第四版,被称为 C11,作为ISO/IEC 9899:2011出版。
在开发过程中,本标准版的草案被称为 C1X

GCC has substantially complete support for this standard, enabled with‘-std=c11’or‘-std=iso9899:2011’.

GCC已经完全支持这个标准,启动选项 '-std=c11''-std=iso9899:2011'

By default, GCC provides some extensions to the C language that, on rare occasions conflict with the C standard.
See Chapter 6 [Extensions to the C Language Family], page 403.

默认情况下,GCC为C语言提供了一些扩展,在极少的情况下,与C标准相冲突。
详见第6章 [ 扩展C语言家族 ], 403页

Some features that are part of the C99 standard are accepted as extensions in C90 mode,
and some features that are part of the C11 standard are accepted as extensions in C90 and C99 modes.

C99标准的部分特性被扩展到了 C90 模式,C11 标准的部分特性被扩展到了 C90 和 C99 模式

Use of the‘-std’options listed above disables these extensions where they conflict with the C standard version selected.

使用上面列出的 '-std' 选项可以禁用这些与 C标准版本冲突的扩展。

You may also select an extended version of the C language explicitly with
‘-std=gnu90’(for C90 with GNU extensions),
‘-std=gnu99’(for C99 with GNU extensions) or
‘-std=gnu11’(for C11 with GNU extensions).

您还可以使用
'-std=gnu90' ( 对应 C90 GNU扩展 ),
'-std=gnu99' ( 对应 C99 GNU扩展 ) 或
'-std=gnu11' ( 对应 C11 GNU扩展 ) 这些选项可以明确地指定 C 语言的扩展版本

The default, if no C language dialect options are given, is‘-std=gnu11’.

默认情况下,如果没有给出C语言方言选项,默认为'std = gnu11'


The ISO C standard defnes (in clause 4) two classes of conforming implementation.

ISO C 标准( 在第四节 ) 规定了两个符合标准的实现方式

A conforming hosted implementation supports the whole standard including all the library facilities;

一个是符合标准的托管实现方式(hosted implementation) 能够支持严格遵循标准的全部库文件(library facilities)

a conforming freestanding implementation is only required to provide certain library facilities :
those in <float.h>, <limits.h>, <stdarg.h>, and <stddef.h>;
since AMD1, also those in <iso646.h>;
since C99, also those in <stdbool.h> and <stdint.h>;
and since C11, also those in <stdalign.h> and <stdnoreturn.h>.
In addition, complex types, added in C99, are not required for freestanding implementations.

而另一个是符合标准的独立实现方式(freestanding implementation) 仅支持某几个库文件 :
这些库文件有 <float.h>, <limits.h>, <stdarg.h>, 和<stddef.h>;
到 AMD1 修正案时,还有 <iso646.h>
到 C99 时, 还有<stdbool.h><stdint.h>;
再到 C11 时, 还有<stdalign.h><stdnoreturn.h>.
此外,在C99 中添加的 complex 类型,在独立实现方式(freestanding implementation)中是不需要的

The standard also defines two environments for programs, a freestanding environment, required of all implementations and which may not have library facilities beyond those required of freestanding implementations,
where the handling of program startup and termination are implementation-defined;

该标准还为程序定义了两个环境,一个是 独立环境(freestanding environment)
要求所有的实现 除了那些独立实现(freestanding implementation)所需的库之外不依赖其他库设施
而且要在指定的地方实现已定义的程序的启动和停止

and a hosted environment, which is not required, in which all the library facilities are provided and startup is through a function int main (void) or int main (int, char *[]).

而对于托管环境(hosted environment)则是通过一个函数int main (void)int main (int, char *[])来启动并且提供了所有的库设施

An OS kernel is an example of a program running in a freestanding environment;

系统内核就是一个在独立环境(freestanding environment)中运行的程序示例;

a program using the facilities of an operating system is an example of a program running in a hosted environment.

而使用操作系统设施的程序就是一个在托管环境(hosted environment)中运行的程序示例。

GCC aims towards being usable as a conforming freestanding implementation, or as the compiler for a conforming hosted implementation.

GCC 的目标是成为符合标准的独立实现 (freestanding implementation)程序,或者作为托管实现(hosted implementation)程序的编译器

By default, it acts as the compiler for a hosted implementation, defning __STDC_HOSTED__ as 1
and presuming that when the names of ISO C functions are used, they have the semantics defned in the standard.

默认情况下,GCC作为托管实现方式(hosted implementation)程序的编译器,
__STDC_HOSTED__定义为1,并且当使用 ISO C 的函数名时,假定它们在标准中定义了语义

To make it act as a conforming freestanding implementation for a freestanding environment,
use the option‘-ffreestanding’;

为使 GCC 作为独立环境(freestanding environment)下的独立实现(freestanding implementation), 可以使用'-ffreestanding' 选项

it then defnes __STDC_HOSTED__ to 0 and does not make assumptions
about the meanings of function names from the standard library, with exceptions noted below.

该选项可以使__STDC_HOSTED__定义为 0 并且不对标准库中函数名做出已定义的假设,下面提到了例外的情况

To build an OS kernel, you may well still need to make your own arrangements for linking and startup.
See Section 3.4 [Options Controlling C Dialect], page 33.

要构建操作系统内核,您可能还需要自行安排链接和启动。
详见3.4节 [ 控制C语言选项 ], 33页

GCC does not provide the library facilities required only of hosted implementations,
nor yet all the facilities required by C99 of freestanding implementations on all platforms.

GCC本身并不提供托管实现(hosted implementations) 所需的库设施,
也不提供C99在所有平台上独立实现(freestanding implementation)所需的所有设施。

To use the facilities of a hosted environment, you need to find them elsewhere (for example, in the GNU C library).
See Section 13.5 [Standard Libraries], page 788.

要使用托管环境的设施,您需要在其他地方找到它们 (比如, GNU 的 C 库)
详见 13.5 节 [ 标准库 ],788页

Most of the compiler support routines used by GCC are present in‘libgcc’, but there are a few exceptions.

GCC使用的大多数编译器支持例程都存在于'libgcc'中,但也有一些例外。

GCC requires the freestanding environment provide memcpy, memmove, memset and memcmp.

GCC需要独立环境(freestanding environment)中提供 memcpy,memmove,memset 和 memcmp

Finally, if __builtin_trap is used, and the target does not implement the trap pattern, then GCC emits a call to abort.

最后,如果使用__builtin_trap,并且目标没有实现陷阱模式(trap pattern),那么GCC将发出一个中止调用。

For references to Technical Corrigenda, Rationale documents and information concerning the history of C that is available online,
see http://gcc.gnu.org/readings.html

参考文献,在线可用的C历史的阐述文档和信息,
详见 http://gcc.gnu.org/readings.html

DB-GPT:企业级私有数据库智能体操作系统 Text2SQL技术正从单次查询翻译迈向多步数据工作流编排,其核心在于解决语义理解偏差、执行不可控与领域知识缺失三大瓶颈。基于LLM的数据库智能体需具备结构化感知、SQL闭环校验、沙箱安全执行及可编排工作流等能力,才能支撑金融、政务等强监管场景的落地需求。DB-GPT通过AWEL工作流引擎、模块化Skill体系与Linux级沙箱机制,实现意图驱动的端到端财报分析、留存率计算等复杂任务,兼顾准确性、可审计性与工程鲁棒性。 阅读详情

相关推荐

【信息科学与工程学】【数据中心】第三十五篇 云计算数据中心的学科知识04

编号学科(课程)核心知识点在云计算/云存储/云网络/云安全/云MaaS中的作用代表教材/资料/论文 + 数学方程式列表工业界应用D1421​云原生数据库:TiDB​HTAP(混合事务/分析处理)、分布式SQL、水平扩展、强一致(Raft)、自动故障恢复、与MySQL兼容、TiFlash列式引擎提供弹性扩展的分布式数据库;支撑高并发在线交易与实时分析教材:《TiDB in Action》PingCAP(2020) 论文:《TiDB: A Raft-based HTAP Database》(2017)

weixin_49199313的博客 208

gcc支持的C语言标准(-std选项)

gcc支持多种版本的C标准,比如C90(ISO1990)、C99(ISO 1999)和C11(ISO2011),除此之外,GCC还会支持一些GCC特有的扩展。分别是: gnu89/gnu90: ISO C90 + GCC extension gnu99: ISO C99 + GCC extension gnu11: ISO C11 + GCC extension 支持的C语言标准可以使用-s...

程序猿Ricky的日常干货 1万+

01_Openclaw环境配置与项目管理工具域详解

OpenClaw工程实战指南:环境配置与项目管理工具详解 本文档是OpenClaw v2.7.9的官方配置指南,全面介绍了这一开源AI Agent操作系统的架构设计与实践应用。OpenClaw采用独特的"本地优先"理念和"数字员工"框架,包含四层架构:应用适配层、生态组件层、核心引擎层和基础设施层。 文档详细阐述了多平台安装方法(Windows/macOS/Linux/Docker)、国内网络稳定接入方案,以及settings.json配置文件的深度解析。特别强调了CLAUDE.md项目指令文件的编写规范。

lza_csdn2019的博客 682

gcc编译器默认支持的c语言标准

c语言有三个标准,分别是c89 c99和最新的c11     楼主使用的gcc的版本是4.8.1,在编译以下一小段测试代码时,如果不加上-std=c99 或者-std=c11,则编译后的程序无法得到正确的运行结果     #include    int main(int argc, char *argv[])   {          int i;       printf("

u010796610的专栏 2933

所有Gcc版本对C和C++的支持情况(超详细版本)

在最近接触的新的项目,由于技术使用为C98风格实现,遇到一个问题需要加锁解决,本能反应用lock_gurad+mutex解决,但是没设置CFLAGS为C++11标准,不确定当前gcc编译器默认支持的C和C++标准是什么,索性就一把都研究透彻,方便后面查看和使用。纯手工一个一个查找标准对照的,十分耗时,多谢支持

Bussy的博客 9万+

gcc的默认c语言标准是哪一个,gcc支持的C语言标准(-std选项)

gcc支持多种版本的C标准,比如C90(ISO1990)、C99(ISO 1999)和C11(ISO2011),除此之外,GCC还会支持一些GCC特有的扩展。分别是:gnu89/gnu90: ISO C90 + GCC extensiongnu99: ISO C99 + GCC extensiongnu11: ISO C11 + GCC extension支持的C语言标准可以使用-std 进行选择...

weixin_35949264的博客 3914

GCC的默认C标准

若没有使用-std参数来指定GCC的C标准, 则使用默认的GNUC90标准(GCC对C99和C11支持得不完整), GNUC90标准在C90标准的基础上进行了扩展. 熟知的C标准大概有三种: c90( or c89), c99, c11. 分别于1990年, 1999年, 2011年发布. 在编译的时候指定c90标准: -ansi, -std=c90 or -std=iso9899:1990;

MJN 1万+

C++ Language Standards Supported by GCC ( GCC 支持的C++语言标准 )

Using the GNU Compiler Collection C++ Language Standards Supported by GCC C++ Language GCC supports the original ISO C++ standard published in 1998, and the 2011 and 2014 revisions. GCC支持1998年出版的原始 ISO

letshi 1514

Objective-C Objective-C++ Language Standards Supported by GCC ( GCC 支持的Objective-C Objective-C++标准 )

Using the GNU Compiler Collection Language Standards Supported by GCC GCC支持语言标准 2.3 Objective-C and Objective-C++ Languages GCC supports“traditional”Objective-C(also known as“Objective-C 1.0”) and contain

letshi 938

[ C语言 ] 发展历程与实践标准

本文梳理了C语言从诞生到标准化的演进历程,重点分析了其与Unix系统的共生关系及对现代计算的基础性影响。丹尼斯·里奇为解决Unix移植性问题而设计的C语言,通过标准化进程(C89/C90、C99、C11、C17/C18)逐步完善,解决了代码兼容性、多线程支持等关键问题。C语言的高效性与可移植性使其成为操作系统、嵌入式系统等底层开发的核心工具,其设计理念深刻影响了后续编程语言的发展。尽管面临新语言的竞争,C语言在性能敏感领域仍保持不可替代的地位,其标准化进程也体现了工业界对稳定性的重视。

A41311141的博客 682

C 标准库 - 参考手册

C 标准库是 C 语言提供的一组标准函数和宏,旨在帮助程序员处理常见的编程任务。它由多个头文件组成,每个头文件定义了特定的功能,如输入输出、字符串处理、数学计算等。这些库函数在不同平台上具有一致的行为,确保了程序的可移植性。C 标准库由一系列头文件组成,每个头文件定义了一组相关的函数、宏和数据类型。这些头文件是 C 语言标准的一部分,确保了不同平台上的 C 程序可以一致地使用这些功能。C 标准库的主要目标是提供通用的、可移植的编程工具,减少程序员的工作量。

likuoelie的博客 1380

10分钟入门Trampoline RTOS:面向初学者的完整指南

Trampoline是一款适用于小型嵌入式系统的静态实时操作系统(RTOS),其API完全符合OSEK/VDX OS和AUTOSAR OS 4.2标准。本指南将帮助你快速掌握Trampoline RTOS的核心概念、安装方法和基础应用,让你在嵌入式开发中轻松上手这个强大的工具。 ## 📌 什么是Trampoline RTOS? Trampoline RTOS专为资源受限的嵌入式系统设计,具有

gitblog_00421的博客 831

Hindsight × Vapi 语音 AI 集成指南:为每一通电话注入持久记忆

Hindsight 为 Agent 提供"会学习、会积累"的长期记忆能力。本文聚焦仓库中 [hindsight-integrations/vapi](https://link.gitcode.com/i/10475e02b7b7def0665f7821b2cddef0) 这一官方集成:它通过一个轻量 Webhook 把 Vapi 语音 AI 的通话接入 Hindsight 记忆系统——通话开始时自

gitblog_00045的博客 368

3.Linux基础开发⼯具【由浅入深-Linux】

在 Windows 环境中,我们习惯了双击 或 文件并一路点击“下一步”来安装软件。但在 Linux 的世界里,软件的分发和安装理念有着本质的不同。Linux 强调权限控制、模块化和依赖管理。为了帮您构建完整的 Linux 系统管理知识体系,我们可以将 Linux 下安装软件的方式归纳为五大主流阵营。这是 Linux 下最正统、也是日常使用频率最高的方式。它又细分为“在线仓库安装”和“本地包安装”两种场景。1. 在线仓库安装(如同手机自带的 App Store) 操作系统维护着一个庞大的软件云端仓库。通

插花弄玉的博客 471

工程师必备:高级搜索技巧精准定位技术文档与开源资源

信息检索是工程师的核心能力之一,其本质是通过特定策略从海量数据中高效提取目标信息。搜索引擎的工作原理基于网络爬虫对网页内容的抓取与索引,而高级搜索技巧则通过操作符直接匹配URL结构或页面标题,实现对非标准发布资源的精准定位。这种技术价值在于能突破常规搜索的局限,直接访问服务器目录、定位特定文件格式或限定专业站点范围,极大提升研发效率。在电子硬件与嵌入式开发领域,典型应用场景包括快速获取芯片数据手册、勘误表、应用笔记,直接定位开源项目的工程文件与SDK,以及高效进行技术调研与竞品分析。本文以工程师的实际工作流

weixin_30376083的博客 454

神玑NX9031X芯片开发实战:智能汽车SoC架构与软硬件集成指南

SoC(系统级芯片)作为智能汽车的核心计算单元,采用多核异构架构集成CPU、NPU和DSP等处理核心,通过硬件加速实现复杂AI算法的高效执行。其技术原理在于通过域控制器架构替代传统分布式ECU,显著提升系统集成度和处理效率。在工程实践中,SoC的价值体现在算力支持、功耗优化和开发便捷性三大维度,能够满足智能座舱、辅助驾驶等场景的实时性要求。以神玑NX9031X芯片为例,该芯片凭借数十TOPS的NPU算力和丰富的车载通信接口,在乐道车型中实现了软硬件深度集成。开发过程中需重点关注HIL测试和OTA升级等关键技

455

postgresql 10.1 分区表之 range 分区

查看数据库版本 select version(); PostgreSQL 10.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18), 64-bit create table语法 CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP }...

一名数据库爱好者的专栏 5821

Linux使用GCC+GDB调试Postgre源码

目录 一、编译安装Postgre 二、使用GDB调试 三、修改源码并且编译运行 四、在源文件中添加头文件编译运行

GNAIXGNAHZ的博客 2117
上一篇: Programming Languages Supported by GCC(GCC 支持的编程语言)
下一篇: C++ Language Standards Supported by GCC ( GCC 支持的C++语言标准 )
letshi
博客等级 码龄16年 3粉丝 9原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值