非常教程

C参考手册

C 语法

#error directive

显示给定的错误消息并呈现程序格式不正确。

句法

#error error_message

说明

遇到#error指令后,实现将显示诊断消息 error_message 并呈现程序不合格(编译停止)。

error_message 可以包含几个不一定用引号引起来的单词。

参考

  • C11标准(ISO / IEC 9899:2011):
    • 6.10.5错误指示(p:174)
  • C99标准(ISO / IEC 9899:1999):
    • 6.10.5错误指示(p:159)
  • C89 / C90标准(ISO / IEC 9899:1990):
    • 3.8.5错误指令

C 语法相关

1.#define directive
2.#elif directive
3.#else directive
4.#endif directive
5.#if directive
6.#ifdef directive
7.#ifndef directive
8.#include directive
9.#line directive
10.#pragma directive
11.alignas
12.Alternative operators and tokens
13.Analyzability
14.Arithmetic operators
15.Arithmetic types
16.Array declaration
17.Array initialization
18.ASCII Chart
19.Assignment operators
20. types
21.Basic concepts
22.Bit fields
23.break statement
24.C language
25.C Operator Precedence
26.cast operator
27.character constant
28.Comments
29.Comparison operators
30.compound literals
31.Conditional inclusion
32.Conformance
33.const type qualifier
34.Constant expressions
35.continue statement
36.Declarations
37.do-while loop
38.Enumerations
39.Escape sequences
40.Expressions
41.External and tentative definitions
42.File scope
43.floating constant
44.for loop
45.Function declarations
46.Function definitions
47.Functions
48.Generic selection
49.goto statement
50.Identifier
51.if statement
52.Implicit conversions
53.Increment/decrement operators
54.Initialization
55.inline function specifier
56.integer constant
57.Lifetime
58.Logical operators
59.Lookup and name spaces
60.Main function
61.Member access operators
62.Memory model
63.Objects and alignment
64.Order of evaluation
65.Other operators
66.Phases of translation
67.Pointer declaration
68.Preprocessor
69.restrict type qualifier
70.return statement
71.Scalar initialization
72.Scope
73.sizeof operator
74.Statements
75.static assert declaration
76.Static storage duration
77.Storage-class specifiers
78.string literals
79.Struct and union initialization
80.Struct declaration
81.switch statement
82.Thread storage duration
83.Type
84.Type
85.Typedef declaration
86.Undefined behavior
87.Union declaration
88.Value categories
89.Variadic arguments
90.volatile type qualifier
91.while loop
92._Alignof operator
93._Noreturn function specifier
C

C 语言是一门通用计算机编程语言,应用广泛。C 语言的设计目标是提供一种能以简易的方式编译、处理低级存储器、产生少量的机器码以及不需要任何运行环境支持便能运行的编程语言。