I frequently hear that Objective-C is a "strict superset" of the C programming language. There are several dialects/standards of C (ie. K&R, ANSI C, C90, C99, GNU extensions...); Objective-C was first developed in the early 1980s, so it has to predate these standards. However, Objective-C 2.0 is from around 2006 or 2007, so it could be based on a more modern C dialect. So, which "C" is Objective-C a superset of?
There's a corresponding "dialect" of Objective-C for all the standard dialects of C.
Given that the most commonly used Objective-C compilers (GCC and Clang) are also C compilers, one would imagine that they support the C dialect(s) supported by these compilers. Apple's documentation specifically states:
The Apple compilers are based on the compilers of the GNU Compiler Collection. Objective-C syntax is a superset of GNU C/C++ syntax, and the Objective-C compiler works for C, C++ and Objective-C source code. The compiler recognizes Objective-C source files by the filename extension .m, just as it recognizes files containing only standard C syntax by filename extension .c. Similarly, the compiler recognizes C++ files that use Objective-C by the extension .mm. Other issues when using Objective-C with C++ are covered in “Using C++ With Objective-C”
So in this case Objective-C is simply regarded as an extension of either the C or C++ compiler depending on which you choose as the base language.
What you're looking for isn't really defined. Objective C is usually thought of a strict superset of ANSI-C (which is the same as C90). However, Objective C isn't a standardized language or anything of that sort. It's description basically is "Take C, and add these features to it". It's therefore dependent on the particular compiler you're using.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With