C (programming language): Difference between revisions

[accepted revision][accepted revision]
Content deleted Content added
Limitations: links, links, links
Limitations: fix disambiguation link
 
Line 571:
* The use of pointers and the run-time manipulation of these means there may be two ways to access the same data (aliasing), which is not determinable at compile time. This means that some optimisations that may be available to other languages are not possible in C. FORTRAN is considered faster.
* Some of the standard library functions, e.g. <code>scanf</code> or {{code|strncat}}, can lead to [[C standard library#Buffer overflow vulnerabilities|buffer overruns]].
* There is limited standardisation in support for low-level variants in generated code, for example: different function [[calling conventions]] and [[Application binary interface|ABI]]; different [[Data structure alignment|structure packing]] conventions; different byte ordering within larger integers (including endianness). In many language implementations, some of these options may be handled with the preprocessor directive <code>[[pragmaC preprocessor#Compiler-specific preprocessor features|#pragma]]</code>,<ref>{{Cite web |last=corob-msft |title=Pragma directives and the __pragma and _Pragma keywords |url=https://learn.microsoft.com/en-us/cpp/preprocessor/pragma-directives-and-the-pragma-keyword |access-date=September 24, 2022 |website=Microsoft Learn |date=March 31, 2022 |language=en-us |archive-date=September 24, 2022 |archive-url=https://web.archive.org/web/20220924075131/https://learn.microsoft.com/en-us/cpp/preprocessor/pragma-directives-and-the-pragma-keyword |url-status=live }}</ref><ref>{{Cite web |title=Pragmas (The C Preprocessor) |url=https://gcc.gnu.org/onlinedocs/cpp/Pragmas.html |access-date=September 24, 2022 |website=GCC, the GNU Compiler Collection |archive-date=June 17, 2002 |archive-url=https://web.archive.org/web/20020617041757/https://gcc.gnu.org/onlinedocs/cpp/Pragmas.html |url-status=live }}</ref> and some with additional keywords e.g. use <code>[[__cdecl]]</code> calling convention. The directive and options are not consistently supported.<ref>{{cite web |title=Pragmas |url=https://www.intel.com/content/www/us/en/develop/documentation/cpp-compiler-developer-guide-and-reference/top/compiler-reference/pragmas.html |publisher=Intel |work=Intel C++ Compiler Classic Developer Guide and Reference |access-date=April 10, 2022 |language=en |archive-date=April 10, 2022 |archive-url=https://web.archive.org/web/20220410113529/https://www.intel.com/content/www/us/en/develop/documentation/cpp-compiler-developer-guide-and-reference/top/compiler-reference/pragmas.html |url-status=live }}</ref>
* [[C string handling|String handling]] using the standard library is code-intensive, with explicit memory management required.
* The language does not directly support object orientation, [[type introspection|introspection]], run-time expression evaluation, generics, etc.