[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: libc6-dev and "-pedantic -O" warnings



Steve Greenland wrote:
> 
> It's not a matter of being OS internal gods. It's a matter of wanting to
> do useful programming. Here's a few of the things you can't do in ISO C:
> 
> - Change current directory (directory is not a concept in ISO C).
> - Interact with user except in line-oriented input/output.
> - do any form of networking.
> 
> That doesn't mean you shouldn't work to minimize the non-ISO C code, or
> to isolate the system specific stuff, and use whatever other standards
> are available (POSIX, etc). But saying "I'm only going to use the
> facilities available in ISO C" is not a practical position for many of
> us.

I agree with this completely... what I mean is, we should be able to
compile in strict ANSI mode even if we call functions which are not
defined in ANSI/ISO C.  Obviously networking of any kind is undefined
under ANSI/ISO, but it's quite useful to be able to write a program that
is 100% ANSI/ISO C, excepting the particular calls to socket() and
connect() et al.

> 
> You're absolutely correct about ctype.h: It's a standard header, and
> should compile without warnings on the strictest compiler settings.
> 

I'm very glad to hear you say this.  What about something like socket.h,
which is not as "standard" but which is commonly used for many
applications?  Shouldn't such headers also compile cleanly in strict
ANSI/ISO mode?

I'm not saying every header in existence should be ANSI/ISO-compatible,
but it seems to me that all headers intended for widespread, general use
by applications programmers should be, at least if they want to be
considered as being "modern" tools.

-- 

 -----------------------------------------------------------------
| Shawn Yarbrough               |  Skepticism is healthy; anyone  |
| shawn@rivalsoftware.com       |  claiming otherwise is either a |
| http://www.rivalsoftware.com  |  con artist or a Christian.     |
 -----------------------------------------------------------------


Reply to: