歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> GCC 筆記 C Dialect Options

GCC 筆記 C Dialect Options

日期:2017/3/1 11:18:07   编辑:Linux編程

C dialects 選項 :

-ansi 支持 C89,關閉不符和C89的 GNU擴展

-std=value value可以是c89,iso9899:1990,iso9989:199409,c99,c9x,iso9899:1999,iso9989:199x,gnu89,gnu99;gcc 默認使用gnu89,gnu99完全實現後,會用gnu99

-traditional 使用 ISO C 之前的C;C89的一些關鍵字還沒不認為是關鍵字:如 inline, typeof, const, volatile 和 signed,這個選項也相當於同時開始-fwritable-strings, -fno-asm選項;

-fsigned-char char默認為signed char

-funsigned-char char 默認為 unsigned char

-fno-signed-char char 只能為unsigned char

-fno-unsinged-char char 只能為signed char

-fwritable-strings 常量字符串可寫

-fhosted 有完整的標准庫可用,程序從 main() 開始,並返回 int,一般的程序都這樣;

-ffreestanding 沒有標准庫可用,程序的開始和結束是和實現相關的,如:linux 內核;

參靠:

The definitive guide to gcc, chapter 1, Compiling C Dialects.

Copyright © Linux教程網 All Rights Reserved