10
13
* better management of different targets for size and alignment of types
11
14
* shared type objects => faster type comparison, less memory consumption...
12
15
* GNU C/C++ extensions:
13
- statement expressions => e.g. ({ int i=0; i; })
14
- omitted middle operand of `?:' expression: foo ? /*empty*/ : bar
15
=> if first operand is nonzero, the value is value of first operand
16
(`x ? : y' has value of `x' if `x' nonzero; otherwise, the value of `y')
17
16
- generalized lvalues => less restrictive isLvalue()
18
- nested functions => skip scope check in fct_def rule
19
17
- introduce variable name after initializer instead of before
20
* improve preprocessor
21
- change macro expansion scheme to fit the standard, e.g.
23
#define hash_hash # ## #
25
#define in_between(a) mkstr(a)
26
#define join(c, d) in_between(c hash_hash d)
29
should result in `"x ## y"' not in `" xy "'
30
- GNU extensions, e.g.
32
#define FILE(x) <a/b/x>
35
results in `#include <a/b/ bar.h >' but GNU's cpp produces
36
`#include <a/b/bar.h>'
22
- change macro expansion scheme to fit the standard, e.g.
24
#define hash_hash # ## #
26
#define in_between(a) mkstr(a)
27
#define join(c, d) in_between(c hash_hash d)
30
should result in `"x ## y"' not in `" xy "'
31
- GNU extensions, e.g.
33
#define FILE(x) <a/b/x>
36
results in `#include <a/b/ bar.h >' but GNU's cpp produces
37
`#include <a/b/bar.h>'
43
1. Thread-Local Storage
44
storage-class __thread
46
2. more built-in functions for C/C++
49
Calculation of real offset is not yet implemented.
50
Currently always returns 0.
52
4. __alignof__, with same syntax as for sizeof
53
Calculation of real alignment is not yet implemented.
54
Currently always returns 1.
56
5. Getting the Return or Frame Address of a Function
57
void * __builtin_return_address (unsigned int level);
58
void * __builtin_frame_address (unsigned int level);
60
6. Function Names as Strings
61
static const char __func__[] = "function-name";
62
__FUNCTION__ = __func__
63
__PRETTY_FUNCTION__ = void a::sub(int)
70
8. Cast to a Union Type
71
union foo { int i; double d; };
78
9. Designated Initializers
80
= { [' '] = 1, ['\t'] = 1, ['\h'] = 1,
81
['\f'] = 1, ['\n'] = 1, ['\r'] = 1 };
82
struct point ptarray[10] = { [2].y = yv2, [2].x = xv2, [0].x = xv0 };
85
structure = ((struct foo) {x + y, 'a', 0});
87
11. C: Non-Constant Initializers
88
void foo (float f, float g) {
89
float beat_freqs[2] = { f-g, f+g };
92
12. Arithmetic on void- and Function-Pointers
93
In GNU C, addition and subtraction operations are supported on pointers to void and on
94
pointers to functions. This is done by treating the size of a void or of a function as 1.
95
A consequence of this is that sizeof is also allowed on void and on function types, and
98
13. Non-Lvalue Arrays May Have Subscripts
99
struct foo {int a[4];};
105
14. Slightly Looser Rules for Escaped Newlines
106
Recently, the preprocessor has relaxed its treatment of escaped newlines. Previously,
107
the newline had to immediately follow a backslash. The current implementation allows
108
whitespace in the form of spaces, horizontal and vertical tabs, and form feeds between
109
the backslash and the subsequent newline.
111
15. Arrays of Variable Length, or Zero, in C/C++
115
17. Conditionals with Omitted Operands
118
18. Referring to a Type with typeof
120
19. Constructing Function Calls (done)
121
void * __builtin_apply_args ()
122
void * __builtin_apply (void (*function)(), void *arguments, size_t size)
123
void __builtin_return (void *result)
126
foo (double a, double b) {
127
double square (double z) { return z * z; }
128
return square (a) + square (b);
136
22. C: Statements and Declarations in Expressions
137
({ int y = foo (); int z;
142
23. Locally Declared Labels
144
__label__ label1, label2, /* ... */;