Looking for quality source code to read

L

Lambda

Hi All,

As a C language newbie, I'd like to read some quality C source code.

Can you recommend some open source C project?
How about GNU libc, or Open Solaris?
I'm interested in how they implement the C Standard Library.

Any recommendation is welcome!
 
I

Ian Collins

Lambda said:
Hi All,

As a C language newbie, I'd like to read some quality C source code.

Can you recommend some open source C project?
How about GNU libc, or Open Solaris?
I'm interested in how they implement the C Standard Library.
From the bits I've read, GNU libc uses a lot of gcc extensions (no
surprises there) and some arcane hand optimisations. OpensSolaris code
tends to be "cleaner" and closer to standard C (Older, crusty K&R bits
excluded!), the lint rules it has to pass are quites strict. Having to
compile with two compilers keeps the use of extensions to a minimum.

Comparing the implementations of standard library functions in the two
can be fun...
 
S

santosh

Hi All,

As a C language newbie, I'd like to read some quality C source code.

Can you recommend some open source C project?
How about GNU libc, or Open Solaris?
I'm interested in how they implement the C Standard Library.

Any recommendation is welcome!

<http://www.snippets.org/>

See also NetBSD's source code. Perhaps 'dietlibc' for a Standard library
example?
 
L

Lambda

From the bits I've read, GNU libc uses a lot of gcc extensions (no
surprises there) and some arcane hand optimisations. OpensSolaris code
tends to be "cleaner" and closer to standard C (Older, crusty K&R bits
excluded!), the lint rules it has to pass are quites strict. Having to
compile with two compilers keeps the use of extensions to a minimum.

Comparing the implementations of standard library functions in the two
can be fun...

Code closer to standard C is fine.
I tried several times to find the standard library,
for example, string related functions, in the opensolaris website, and
failed.

I don't know how the source code is organized and where the library is
located.
Is there such a document?
 
I

Ian Collins

Lambda said:
Code closer to standard C is fine.
I tried several times to find the standard library,
for example, string related functions, in the opensolaris website, and
failed.

I don't know how the source code is organized and where the library is
located.
Is there such a document?
cvs.opensolaris.org
 
K

Keith Thompson

Lambda said:
Code closer to standard C is fine.
I tried several times to find the standard library,
for example, string related functions, in the opensolaris website, and
failed.

Note that the code used to *implement* the standard library isn't
necessarily standard code. In some cases, it's likely to use every
system-specific trick the implementers can think of to make it run as
fast as possible. It's not necessarily going to be a good model for
writing your own code.
 
I

Ian Collins

Lambda said:
There is a project list, such as audit, bluetooth, brussels...
Which project should I look for the standard library in?
*Please* don't quote signatures.

Do a search for the function you want to study, it's a very easy
interface to use.
 
K

Keith Thompson

Lambda said:
There is a project list, such as audit, bluetooth, brussels...
Which project should I look for the standard library in?

We don't know. Try asking in comp.unix.solaris.
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top