[avahi] Question about avahi-ui.c

Lennart Poettering lennart at poettering.net
Wed Sep 26 04:10:06 PDT 2007


On Wed, 26.09.07 08:37, Padraig O'Briain (Padraig.Obriain at Sun.COM) wrote:

> > Sure. But couldn't you guys just fix Solaris' printf? Maybe as part of
> > this project "Indiana" thing? I mean, this is not the first time Sun
> > guys report an issue like this against a developed-on-Linux project,
> > is it?
> >   
> 
> No. This has been discussed before. See 
> http://mail.opensolaris.org/pipermail/opensolaris-code/2006-July/002972.html.

Wow, once in a while Jörg Schilling is right!

The position of the Solaris devs on this is stupid. Setting a pointer
to NULL is the official way how C people set something to a
"disabled", "deactivated" state. Like the NULL value in SQL. As such
it is clearly not a programming error if I set something to NULL.

Those people on the Solaris ML repeatedly say that a string set to
NULL is a programming error. This is just stupid. Setting a string to
NULL is one of the most common and most of the time correct things to
do. Being unable to print it is just a unnecessary PITA.

The purpose of printf() is to show the state of the program to the
user. It is *not* to crash on valid program states.

Also, checking for NULL strings is trivial. Costs almost nothing.

So, Sun now wants to make solaris as sexy as Linux for hacking Free
Software. How about starting with making it a sane programming
environment?

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4


More information about the avahi mailing list