DragonFly BSD
DragonFly commits List (threaded) for 2005-07
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cvs commit: src/sys/sys errno.h

From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Sun, 3 Jul 2005 18:31:50 +0200

Lately Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx> said:
> > 	Unless the project wants to loose prospective users we shouldn't force the
> > dogmatic
> > 	attitude of "recompile it source because we have done it in a clean way,
> > blah" etc.  Most
> > 	of the users do not really care about the source code as much they care about
> > their
> > 	applications working in one piece.
> This is not so much about recompilation, but about correctness of code. The problem
> here is that staying compatible with the historic practise actually hinders future
> development. There's still a lot of code out there which wants to define e.g. strcpy
> manually. This means we can't change the definition to include e.g. restrict, without
> breaking such code. What is better? Breaking code which lives in the K&R days or
> following standards?

We are, in fact, following the standards. Absolutely. I can't see where
not. Yet, we do not *enforce* the standards onto others so that our users
can get working programs without having to patch manually (what most of
our users can't or don't want to, not to speak from submitting patches
upstream). ISO C99 explicitly mentions the possible way of expanding
`errno' to "for example, *errno()". And this is what we do. We even make
this function inline so that generated code is nice.

> To summarize the situation: "extern int errno;" is INCORRECT. It is undefined behaviour
> and unnecessary for any platform which has errno.h and ANSI C headers. If there are
> still platforms out there, which have errno.h and don't define errno, all projects I've
> seen which had explicit defines would break *anyway*, because they don't do it
> consistently.

I agree. But with this commit we reduce breakage on our side. Where is
the problem? We are standards compliant, but we don't enforce it onto
others. That strict and liberal thing, you know?


Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low $$$ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \

Attachment: pgp00003.pgp
Description: PGP signature

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