Home:ALL Converter>C - What are C implementations?

C - What are C implementations?

Ask Time:2019-04-15T22:17:12         Author:AlexQualcosa

Json Formatter

Could you give me an explanation of what exactly an implementation is, taking inspiration from the three highlighted expressions?

From "C Primer Plus" > Language Standards

Currently, many C implementations are available. Ideally, when you write a C program, it should work the same on any implementation, providing it doesn’t use machine-specific programming. For this to be true in practice, different implementations need to conform to a recognized standard.

Author:AlexQualcosa,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/55691197/c-what-are-c-implementations
Serge Ballesta :

A standard conforming C implementation consists of a compiler that translates compilation units as mandated by the standard, an implementation of the standard library for all functions required by the standard and something (normally a linker) that puts everything together to build an executable file. In fact the implementation also includes all the software required to then run the produced executable.\n\nWe commonly speak of compilers (gcc, clang, msvc) when we should speak of C development environment. And inside each vendor system, you may have different implementations, because for example gcc or clang can generate executables for different int sizes (32 or 64 bits) and eventually different endiannesses. Each configuration then constitutes a specific implementation.\n\nTo be more exhaustive, it should be noted that support the standard library may be optional in so called standalone execution environment (by opposition to hosted execution environment). In real world, standalone mode is used for kernel development, because the kernel must be able to start before all the functions from the standard library are available. Else we would have a chicken and egg problem if the kernel required functions that it only can provide when it is fully loaded...\n\n\n\nReferences: The draft n1570 for C11 defines an implementation as:\n\n3.12\n implementation:\nparticular set of software, running in a particular translation environment under particular\ncontrol options, that performs translation of programs for, and supports execution of\nfunctions in, a particular execution environment",
2019-04-15T14:26:41
johannes :

C is typically implemented by a C compiler. In that paragraph you could simply replace this accordingly.\n\nA reason for the more generic term \"implementation\" is that a compiler might contain multiple frontends or be made out of different tasks, or there are theoretically other forms than a compiler thinkable.\n\nThe C standard is defined against a \"abstract machine\" which behaves as the standard describes but doesn't have any other requirements and defines mapping to real machines as exercise for the implementor.",
2019-04-15T14:23:15
yy