J
Jim Showalter
Does a hosted implementation require any particular libraries in order to be
considered a standard C compiler?
considered a standard C compiler?
Jim said:Does a hosted implementation require any particular libraries in order to be
considered a standard C compiler?
Does a hosted implementation require any particular libraries in order to
be considered a standard C compiler?
Jim said:Does a hosted implementation require
any particular libraries in order to be
considered a standard C compiler?
Richard said:Jim Showalter said:
A hosted implementation must provide
all the standard library functions, but
the Standard does not say in what form they must be provided.
jacob said:I suppose that the standard C library (at least) should be present.
In any case a compiler without any library is not very useful...
jacob
Jim Showalter said:That's what I thought, too. But I've installed the latest versions
of MinGW along with gcc-core, and cannot find even a mention of libc
or glibc.
Yes.
C89, hosted:
<assert.h> <locale.h> <stddef.h>
Yes.
This directive in a C file: #include <float.h>
only means that the compiler has to compile the C file
as though float.h was pasted in there.
If that can be done without a float.h file being present,
then there doesn't need to be a float.h file
in the hosted implementation.
Yes. the standard library.Jim Showalter said:Does a hosted implementation require any particular libraries in order to
be
considered a standard C compiler?
Richard said:pete said:
Yes.
C89, hosted:
<assert.h> <locale.h> <stddef.h>
[etc]
Those are not libraries. They're headers.
<snip>
Jim said:That's what I thought, too. But I've installed the latest versions of MinGW
along with gcc-core, and cannot find even a mention of libc or glibc.
Richard said:pete said:
Jim Showalter wrote:
Does a hosted implementation require
any particular libraries in order to be
considered a standard C compiler?
Yes.
C89, hosted:
<assert.h> <locale.h> <stddef.h>
[etc]
Those are not libraries. They're headers.
<snip>
Parts of the standard library,
are sometimes refered to as "libraries",
Erroneously.
such as "the math library",
which is mentioned in the FAQ.
http://c-faq.com/fp/libm.html
This rather ancient implementation will provide you with
C89 semantics with a compiler that can possible emit
C99 code, so take care as not to ask for anything
recent what standards is concerned.
At the same time, even if the compiler accepts and emits
code for long doubles, mingw doesn't have any library support
for long doubles so better not use them.
This means that the printf provided by crtdll.dll is strictlythose said:in comp.lang.c i read:
[re: platform provided standard c library]
This rather ancient implementation will provide you with
C89 semantics with a compiler that can possible emit
C99 code, so take care as not to ask for anything
recent what standards is concerned.
eh? decoder ring needed.
At the same time, even if the compiler accepts and emits
code for long doubles, mingw doesn't have any library support
for long doubles so better not use them.
that would be sad then, since long double has been part of the language for
a long time [c89 3.1.2.5].
This means that the printf provided by crtdll.dll is strictly
C89 and doesn't provide any way of printing either
long doubles, long longs or any normal printf directives.
Yes, but microsoft implemented long double as a
synonym for double.
jacob navia said:
That's a contradiction. If it's strictly C89, it will provide a way to print
long doubles.
<snip>
Only in some of their implementations. I have a couple of Microsoft
compilers with 80-bit long doubles, compared to just 64 bits for double.
Richard Heathfield a écrit :jacob navia said:
That's a contradiction. If it's strictly C89, it will provide a way to
print long doubles.
<snip>
#include <stdio.h>
int main(int argc, char *argv[])
{
long double d = 1e600L;
printf("%Le\n",d);
return 0;
}
This will FAIL under mingw.
Yes, very ancient implementations have real long doubles. Modern ones
have not.
Why confuse people? It is your hobby or what?
jacob said:Richard Heathfield a écrit :jacob navia said:
That's a contradiction. If it's strictly C89, it will provide a way to
print long doubles.
<snip>
#include <stdio.h>
int main(int argc, char *argv[])
{
long double d = 1e600L;
printf("%Le\n",d);
return 0;
}
This will FAIL under mingw.
I posted you this message in another thread but you continue
to post nonsense.
Michael said:Yes, but the problem is that mingw plus MS libs is _not_ a
conforming implementation.
long doubles, doubles, and floats can have exactly the same size
and representation.
The above code relies on implementation limits rather than
guaranteed standard limits (LDBL_MAX is guaranteed to be at least
1E+37).
The obvious fix is to not use mingw in this combination as it is
broken (or keep in mind that it is broken w.r.t. long double I/O).
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.