[14242] in SIPB bug reports
Re: sipb linux pine fixed
daemon@ATHENA.MIT.EDU (Jacob Morzinski)
Sat Jul 10 23:21:04 2004
From jmorzins@MIT.EDU Sun Jul 11 03:21:04 2004
Return-Path: <jmorzins@MIT.EDU>
Delivered-To: bug-sipb-mtg@CHARON.mit.edu
Received: (qmail 29994 invoked from network); 11 Jul 2004 03:21:04 -0000
Received: from biscayne-one-station.mit.edu (18.7.7.80)
by charon.mit.edu with SMTP; 11 Jul 2004 03:21:04 -0000
Received: from melbourne-city-street.mit.edu (MELBOURNE-CITY-STREET.MIT.EDU [18.7.21.86])
by biscayne-one-station.mit.edu (8.12.4/8.9.2) with ESMTP id i6B3Ku7q003234;
Sat, 10 Jul 2004 23:20:56 -0400 (EDT)
Received: from multics.mit.edu (MULTICS.MIT.EDU [18.187.1.73])
(authenticated bits=56)
(User authenticated as jmorzins@ATHENA.MIT.EDU)
by melbourne-city-street.mit.edu (8.12.4/8.12.4) with ESMTP id i6B3KtOm014500;
Sat, 10 Jul 2004 23:20:56 -0400 (EDT)
Received: (from jmorzins@localhost) by multics.mit.edu (8.12.9)
id i6B3KrjJ025959; Sat, 10 Jul 2004 23:20:53 -0400 (EDT)
Date: Sat, 10 Jul 2004 23:20:53 -0400 (EDT)
From: Jacob Morzinski <jmorzins@MIT.EDU>
To: bug-sipb@MIT.EDU
cc: Greg Hudson <ghudson@MIT.EDU>
Subject: Re: sipb linux pine fixed
In-Reply-To: <1089512297.24763.467.camel@egyptian-gods.mit.edu>
Message-ID: <Pine.GSO.4.55L.0407102221570.21374@multics.mit.edu>
References: <Pine.LNX.4.30L.0407101412050.29102-100000@opus.mit.edu>
<1089512297.24763.467.camel@egyptian-gods.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Sat, 10 Jul 2004, Greg Hudson wrote:
> I can't really explain all of this behavior, but in theory, the faux pas
> is to use "extern int errno;" instead of "#include <errno.h>".
>
Exactly.
On Solaris and Linux, <errno.h> defines errno to be a macro
wrapper around a function that returns a pointer to an int,
something similar to:
extern int *__errno_location();
#define errno (*__errno_location ())
I did look around the code, and on my first search all of the
files that declared errno did so with lines of the form:
#include <errno.h>
extern int errno; /* just in case */
As far as I was able to determine through test programs,
this syntax seems safe. My test programs didn't trigger the
errno/h_errno warning when they used this declaration; they
only triggered the warning when they omitted the #include.
The picture is more complicated... Pine has a fairly ugly build
system, and it creates some source and header files on the fly
during its build. Pre-build, there do seem to be source file
fragments that use errno without declaring it. It's reasonable
to wonder whether these file fragments treat errno properly after
they've been merged into whole files. It's also reasonable to
wonder whether my first-time search of the other source files was
thorough enough to find all uses of errno and <errno.h>.
It's a hairy mess. If there were a permanent problem problem,
it might be worth solving. A problem that comes and goes,
though, isn't worth it.
-Jake