SuperC documentation

SuperC is a superset of C

What does it mean that SuperC is a superset of C11?

SuperC adds new rich features to C, without breaking compatibility with C11.

Differences with C

Even though SuperC compile C code, there are some changes made on purpose over the C spec.

Inline functions

In C99

inline keyword does not always make the function inlined, but rather tells the compiler to decide when to inline the function. In order to make it always inline you would have to use __attribute__((always_inline)).

As a result of this defensive definition, most inline functions are never inlined, which may be unexpected and unintuitive for non-battle-scarred C programmers.

https://en.wikipedia.org/wiki/Inline_(C_and_C++)#Storage_classes_of_inline_functions


In SuperC

inline keyword makes the function inlined always, because it’s the user decision to make it inline or not.

If we don’t want it to be inlined, we can just remove inline from the function declaration.

__func__ and __FUNCTION__

Like GCC, SuperC supports the __func__/__FUNCTION__ macros, which returns the name of the current function.


Previous

Function overload

Next

(DRAFT) Lambda Expressions & Closures