From 660a5ac8ec8afb1b609fdfb91df82dca9ed1e187 Mon Sep 17 00:00:00 2001
From: Eli Friedman
Date: Tue, 28 Apr 2009 18:48:34 +0000
Subject: [PATCH] Add some text to the user manual describing the current state
of C support in clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70314 91177308-0d34-0410-b5e6-96231b3b80d8
---
docs/UsersManual.html | 132 ++++++++++++++++++++++++++++++++++++++++--
1 file changed, 126 insertions(+), 6 deletions(-)
diff --git a/docs/UsersManual.html b/docs/UsersManual.html
index 4167f6183f..934e6843b6 100644
--- a/docs/UsersManual.html
+++ b/docs/UsersManual.html
@@ -38,10 +38,11 @@ td {
C Language Features
Objective-C Language Features
@@ -482,15 +483,134 @@ and not specified on the command line using -include.
C Language Features
+The support for standard C in clang is feature-complete except for the C99
+floating-point pragmas.
-Intentional Incompatibilities with GCC
+Extensions supported by clang
+
+
+See clang language extensions.
+
+Differences between various standard modes
+
+
+clang supports the -std option, which changes what language mode clang uses.
+The supported modes for C are c89, gnu89, c94, c99, gnu99 and various aliases
+for those modes. If no -std option is specified, clang defaults to gnu99 mode.
+
-No VLAs in structs.
+Differences between all c* and gnu* modes:
+
+- c* modes define "__STRICT_ANSI__".
+- Target-specific defines not prefixed by underscores, like "linux", are defined
+in gnu* modes.
+- Trigraphs default to being off in gnu* modes; they can be enabled by the
+-trigraphs option.
+- The parser recognizes "asm" and "typeof" as keywords in gnu* modes; the
+variants "__asm__" and "__typeof__" are recognized in all modes.
+- Some warnings are different.
+
+Differences between *89 and *99 modes:
+
+- The *99 modes default to implementing "inline" as specified in C99, while
+the *89 modes implement the GNU version. This can be overridden for individual
+functions with the __gnu_inline__ attribute.
+- Digraphs are enabled in the *99 modes.
+- The scope of names defined inside a "for", "if", "switch", "while", or "do"
+statement is different. (example: "if ((struct x {int x;}*)0) {}".)
+- __STDC_VERSION__ is not defined in *89 modes.
+- "inline" and "restrict" are not recognized as keywords in c89 mode.
+- Commas are allowed in integer constant expressions in *99 modes.
+- Arrays which are not lvalues are not implicitly promoted to pointers in
+*89 modes.
+- Constructs like "&*X" are always allowed in *99 modes.
+- Some warnings are different.
+
+c94 mode is identical to c89 mode except that digraphs are enabled in
+c94 mode (FIXME: And __STDC_VERSION__ should be defined!).
+
+
+GCC extensions not implemented yet
+
+
+clang tries to be compatible with gcc as much as possible, but some gcc
+extensions are not implemented yet:
+
+
+- clang does not support __label__
+(bug 3429). This is
+a relatively small feature, so it is likely to be implemented relatively
+soon.
+
+- clang does not support attributes on function pointers
+(bug 2461). This is
+a relatively important feature, so it is likely to be implemented relatively
+soon.
+
+- clang does not support #pragma weak
+(bug 3679). Due to
+the uses described in the bug, this is likely to be implemented at some
+point, at least partially.
+
+- clang does not support #pragma align
+(bug 3811). This is a
+relatively small feature, so it is likely to be implemented relatively
+soon.
+
+- clang does not implement overloads for the __sync_* builtins
+(bug 3824). The
+builtins only currently work with 32-bit types. This is a relatively
+small feature, so it is likely to be implemented relatively soon.
+
+- clang does not support code generation for variables pinned to registers
+(bug 3933). This
+is a relatively small feature, so it is likely to be implemented relatively
+soon.
+
+- clang does not support decimal floating point types (_Decimal32 and
+friends) or fixed-point types (_Fract and friends); nobody has expressed
+interest in these features yet, so it's hard to say when they will be
+implemented.
+
+- clang does not support nested functions; this is a complex feature which
+is infrequently used, so it is unlikely to be implemented anytime soon.
+
+- clang does not support __builtin_apply and friends; this extension requires
+complex code generator support that does not currently exist in LLVM, and there
+is very little demand, so it is unlikely to be implemented anytime soon.
+
+
+
+This is not a complete list; if you find an unsupported extension
+missing from this list, please send an e-mail to cfe-dev. This list
+currently excludes C++; see C++ Language Features.
+Also, this list does not include bugs in mostly-implemented features; please
+see the
+bug tracker for known existing bugs (FIXME: Is there a section for
+bug-reporting guidelines somewhere?).
+
+
+Intentionally unsupported GCC extensions
+
+
+clang does not support the gcc extension that allows variable-length arrays
+in structures. This is for a few of reasons: one, it is tricky
+to implement, two, the extension is completely undocumented, and three, the
+extension appears to be very rarely used.
+
+
+Microsoft extensions
+
+clang has some experimental support for extensions from
+Microsoft Visual C++; to enable it, use the -fms-extensions command-line
+option. Eventually, this will be the default for Windows targets.
+These extensions are not anywhere near complete, so please do not
+file bugs; patches are welcome, though.
Objective-C Language Features
--
2.40.0