Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > standard libraries

Reply
Thread Tools

standard libraries

 
 
Jim Showalter
Guest
Posts: n/a
 
      09-16-2006
Does a hosted implementation require any particular libraries in order to be
considered a standard C compiler?
--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/ Everything should be made as simple as possible, but not simpler.
_/ -- Albert Einstein
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
 
Reply With Quote
 
 
 
 
jacob navia
Guest
Posts: n/a
 
      09-16-2006
Jim Showalter wrote:
> Does a hosted implementation require any particular libraries in order to be
> considered a standard C compiler?


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
 
Reply With Quote
 
 
 
 
Richard Heathfield
Guest
Posts: n/a
 
      09-16-2006
Jim Showalter said:

> Does a hosted implementation require any particular libraries in order to
> be considered a standard C compiler?


A hosted implementation must provide all the standard library functions, but
the Standard does not say in what form they must be provided.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
 
Reply With Quote
 
pete
Guest
Posts: n/a
 
      09-16-2006
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>
<ctype.h> <math.h> <stdio.h>
<errno.h> <setjmp.h> <stdlib.h>
<float.h> <signal.h> <string.h>
<limits.h> <stdarg.h> <time.h>

C89, freestanding:
<float.h> <limits.h> <stdarg.h>
<stddef.h>

C99, hosted:
<assert.h> <complex.h> <ctype.h>
<errno.h> <fenv.h> <float.h>
<inttypes.h> <iso646.h> <limits.h>
<locale.h> <math.h> <setjmp.h>
<signal.h> <stdarg.h> <stdbool.h>
<stddef.h> <stdint.h> <stdio.h>
<stdlib.h> <string.h> <tgmath.h>
<time.h> <wchar.h> <wctype.h>

C99, freestanding
<float.h> <iso646.h> <limits.h>
<stdarg.h> <stdbool.h> <stddef.h>
<stdint.h>

--
pete
 
Reply With Quote
 
pete
Guest
Posts: n/a
 
      09-16-2006
Richard Heathfield wrote:
>
> Jim Showalter said:
>
> > Does a hosted implementation require
> > any particular libraries in order to
> > be considered a standard C compiler?

>
> A hosted implementation must provide
> all the standard library functions, but
> the Standard does not say in what form they must be provided.


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.

--
pete
 
Reply With Quote
 
Jim Showalter
Guest
Posts: n/a
 
      09-16-2006
jacob navia wrote:
>
> 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


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.

--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/ Everything should be made as simple as possible, but not simpler.
_/ -- Albert Einstein
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      09-16-2006
Jim Showalter <(E-Mail Removed)> writes:
> jacob navia wrote:
>> I suppose that the standard C library (at least) should be present.
>> In any case a compiler without any library is not very useful...

>
> 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.


The standard says nothing about "libc" or "glibc". As long as a
program that includes standard headers and calls standard library
functions works as specified in the standard, it doesn't matter how
the implementation does it.

<OT>gcc typically uses whatever runtime library is provided by the
underlying operating system. I don't know what MinGW does.</OT>

If you're curious about the details of how your implementation
provides the standard library headers and fucntions, either check your
implementation's documentation or ask in a system-specific newsgroup.

--
Keith Thompson (The_Other_Keith) http://www.velocityreviews.com/forums/(E-Mail Removed) <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      09-16-2006
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>

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      09-16-2006
pete said:

> Richard Heathfield wrote:
>>
>> Jim Showalter said:
>>
>> > Does a hosted implementation require
>> > any particular libraries in order to
>> > be considered a standard C compiler?

>>
>> A hosted implementation must provide
>> all the standard library functions, but
>> the Standard does not say in what form they must be provided.

>
> 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.


What has <float.h> to do with libraries?

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
 
Reply With Quote
 
Malcolm
Guest
Posts: n/a
 
      09-17-2006
"Jim Showalter" <(E-Mail Removed)> wrote
>
> Does a hosted implementation require any particular libraries in order to
> be
> considered a standard C compiler?
>

Yes. the standard library.
The problem is that most hosted implementations run on computers with
graphical user interfaces, and there are no standard library functions for
communicating with a GUI. Some evil systems also take away streams such as
stderr and stdout, which makes life very difficult.
--
www.personal.leeds.ac.uk/~bgy1mm
freeware games to download.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
standard libraries don't behave like standard 'libraries' Sriram Srinivasan Python 13 11-12-2009 06:05 PM
Using mandatory libraries (custom class loading vs. expanding libraries) Karsten Wutzke Java 21 06-29-2007 09:25 PM
C++ skills and commonly (?) used non-standard libraries. fabio de francesco C++ 3 08-27-2004 06:15 AM
Custom JSP libraries documentation standard kir Java 1 09-16-2003 06:45 PM
Re: Help Please: C/C++ Standard Libraries Greg P. C++ 3 08-28-2003 06:38 AM



Advertisments