bug-gnulib
[Top][All Lists]
Advanced

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

Re: strsignal module


From: Colin Watson
Subject: Re: strsignal module
Date: Tue, 8 Jan 2008 22:44:36 +0000
User-agent: Mutt/1.5.13 (2006-08-11)

On Tue, Jan 08, 2008 at 01:56:55AM +0100, Bruno Haible wrote:
> Colin Watson wrote:
> > I use strsignal in man-db, and would like a Gnulib module to cope with
> > its portability problems. Here's one which seems to be doing the right
> > thing for me so far. This is my first attempt at writing a Gnulib module
> > from scratch, so I'd appreciate any comments, style or otherwise.
> 
> Thanks! It's very well done. Only a few minor nits:
>   - All added or modified files should contain the year 2008 in the
>     copyright statement.
>   - The use of the macro gl_once_define should not have a semicolon at
>     the end, otherwise you get an ANSI C syntax error on platforms where
>     gl_once_define(...) expands to empty.
>   - The unit test uses SIGHUP, which is not defined on mingw.
>   - I don't understand the #if logic in the unit test. Shouldn't it be like
>     this:?

Thanks. The attached updated patches address your concerns and Paul's
(although anything that starts '#define __foo' makes me itchy; C99 7.1.3
para. 2 explicitly says that this is undefined behaviour, but several
parts of Gnulib already do this, so ...). I still needed an #ifdef _LIBC
in the init function since I didn't want to use GCC extensions to
squeeze gl_tls_key_init into an if expression.

The weird logic in the unit test was because I had assumed that SIGHUP
was available everywhere and was trying to ensure that at least one test
was run on every platform. Since I'm wrong and since the result looked
odd anyway, I've adopted a simplified version of your suggestion.

I'd still like to know if anyone has any suggestions that avoid the
snprintf dependency.

Cheers,

-- 
Colin Watson                                       address@hidden

Attachment: gnulib.strsignal.diff
Description: Text Data

Attachment: gnulib.strsignal-vs-libc.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]