forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest2.cpp
More file actions
121 lines (73 loc) · 1.49 KB
/
test2.cpp
File metadata and controls
121 lines (73 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*
* This sentence contains a semicolon;
* however, this doesn't make it code.
*/
// This sentence contains a semicolon;
// however, this doesn't make it code.
/* Mention a ';' */
/* Mention a '{' */
/* JSON example: {"foo":"bar"} */
/* JSON example in backticks: `{"foo":"bar"}` */
/* JSON example in quotes: '{"foo":"bar"}' */
/*
* Code example: `return 0;`.
*/
// Code example:
//
// return 0;
// Code example:
//
// ```
// return 0;
// ```
// { 1, 2, 3, 4 }
// Example: { 1, 2, 3, 4 }
// int myFunction() { return myValue; }
// int myFunction() const { return myValue; }
// int myFunction() const noexcept { return myValue; }
// #define MYMACRO
// #include "include.h"
/*
#ifdef
void myFunction();
#endif
*/
// define some constants
// don't #include anything here
// #hashtag
// #if(defined(MYMACRO))
// #iffy
// #pragma once
// # pragma once
/*#error"myerror"*/
#ifdef MYMACRO
// ...
#endif // #ifdef MYMACRO
#if !defined(MYMACRO)
// ...
#else // #if !defined(MYMACRO)
// ...
#endif // #else #if !defined(MYMACRO)
#ifdef MYMACRO
// ...
#endif // #ifdef MYMACRO (comment)
/*
#ifdef MYMACRO
// ...
#endif // #ifdef MYMACRO
*/
#ifdef MYMACRO1
#ifdef MYMACRO2
// ...
// comment at end of block
#endif // #ifdef MYMACRO2
#endif // #ifdef MYMACRO1
#include "config.h" // #include "config2.h"
#ifdef MYMACRO
// ...
#endif /* #ifdef MYMACRO */
#error "error" /* #ifdef MYMACRO */
// commented_out_code();
#if 0
// commented_out_code();
#endif