On Fri, 4 Jan 2002, Dave Lovelace wrote:
> Alan Sundell wrote, in part:
> >
> > Or, (IMHO -- correct me if I'm wrong) just get rid of the DEBUG1
> > statement altogether (why is it necessary to print the values of
> > compile-time constants like AF_UNIX and AF_LOCAL at run time?).
> >
> Because when you have problems at run time, you may need to figure out
> what compile-time options were used?

What I meant was not "compile-time constants (e.g. AF_UNIX and
AF_LOCAL)," but rather "compile-time constants of the sort that includes
AF_UNIX and AF_LOCAL."

I understand the value of printing compile-time options.  Many programs
(e.g. mutt) will print them out along with the version information.

There is a difference, however, between the compile-time options that a
user or admin can select with flags to ./configure or by editing some
options header file, and the constants that are defined in the kernel
and exported (so to speak) in the system header files, like AF_UNIX.
The latter are not "compile-time options" by any stretch of the
imagination.

Besides, if I tell you that that particular debug statement says that
AF_UNIX is 187, that may seem odd, but it really doesn't mean a thing
unless I happen to attach my kernel sources (and, for example, in Linux,
/etc/modules.conf and all my modules).

Sure, someone *could* redefine AF_UNIX, but trying to protect yourself
against that is a lose-lose situation.  Once you start going down that
road, why stop at AF_UNIX?  Hey, why not tar up /usr/include, gzip it,
and stick that in the binary?

All of this is just programming philosophy, and it doesn't really
matter, of course.  The statement and its #ifdefs will probably stay in,
and they are just a drop in the bucket compared to all the other printf
debugging going on.  When it comes down to it, I really don't care how
LPRng is done, so long as it works.

On the other hand, if the debug statement doesn't really provide any
useful information but means maintaining yet another crazy #ifdef tree,
why bother with it?  It's just another thing to break portability
(again) down the road.  That latter part is where the "so long as it
works" comes into play, and that is why I suggested it be eliminated.

Anyway, like I said, it's not really that important, and my opinions
are, of course, humbly sumbitted.

--Alan "read too much Alexander Viro today and trying not to let it
        affect him" Sundell


-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to