Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gcc_extensions [2019/07/25 12:35] – [Local labels] rpjdaygcc_extensions [2019/07/25 12:53] (current) – [Case ranges] rpjday
Line 33: Line 33:
 goto *ptr; goto *ptr;
 </code> </code>
 +
 +==== Nested functions ====
 +
 +<code>
 +foo (double a, double b)
 +{
 +  double square (double z) { return z * z; }
 +
 +  return square (a) + square (b);
 +}
 +</code>
 +
 +See "trampolines."
 +
 +==== Nonlocal gotos ====
 +
 +Use ''%%__builtin_setjmp%%'' and ''%%__builtin_longjmp%%''.
 +
 +==== Constructing function calls ====
 +
 +==== typeof ====
 +
 +<code>
 +#define max(a,b) \
 +  ({ typeof (a) _a = (a); \
 +      typeof (b) _b = (b); \
 +    _a > _b ? _a : _b; })
 +</code>
 +
 +==== Conditionals ====
 +
 +Equivalent:
 +
 +<code>
 +x ? x : y
 +x ? : y
 +</code>
 +
 +==== Non-constant initializers ====
 +
 +==== Designated initializers ====
 +
 +==== Case ranges ====
 +
 +<code>
 +case low ... high:
 +</code>
 +
 +Don't forget spaces.
 +
 +
  
  • gcc_extensions.1564058137.txt.gz
  • Last modified: 2019/07/25 12:35
  • by rpjday