From b241411e502002395e4dcb2083bb3328dff66bd4 Mon Sep 17 00:00:00 2001
From: Richard Smith By default, Clang builds C code according to the C99 standard,
-which provides different semantics for the By default, Clang builds C code in GNU C11 mode, so it uses standard C99
+semantics for the By contrast, GCC's default behavior follows the GNU89 dialect,
-which is the C89 standard plus a lot of extensions. C89 doesn't have
-an By contrast, GNU C89 mode (used by default in older versions of GCC) is the
+C89 standard plus a lot of extensions. C89 doesn't have an There are several ways to fix this problem:C99 inline functions
-inline
keyword
-than GCC's default behavior. For example, consider the following
-code:inline
keyword. These semantics are different
+from those in GNU C89 mode, which is the default mode in versions of GCC
+prior to 5.0. For example, consider the following code:
inline int add(int i, int j) { return i + j; }
@@ -110,10 +110,10 @@ Undefined symbols:
_main in cc-y1jXIr.o
-inline
keyword, but GCC recognizes it as an extension
-and just treats it as a hint to the optimizer.inline
+keyword, but GCC recognizes it as an extension and just treats it as a hint to
+the optimizer.
inline
) definition
of add
somewhere else in your program. The two
definitions must be equivalent!-std=gnu89
to the set of Clang options. This option is
only recommended if the program source cannot be changed or if the
program also relies on additional C89-specific behavior that cannot
--
cgit v1.2.3