bug-gnulib
[Top][All Lists]
Advanced

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

Re: argp: listen to gcc warnings


From: Bruno Haible
Subject: Re: argp: listen to gcc warnings
Date: Sat, 24 Mar 2007 14:25:09 +0100
User-agent: KMail/1.5.4

Eric Blake wrote:
> Rather than use lots of casts, coreutils does this in a common header:
> 
> /* Convert a possibly-signed character to an unsigned character.  This is
>    a bit safer than casting to unsigned char, since it catches some type
>    errors that the cast doesn't.  */
> static inline unsigned char to_uchar (char ch) { return ch; }

This figures better type safety (yields a warning when one passes a pointer
instead of an integer type), at the expense of debugging (you know how
confusing gdb behaves when you step through inline functions) and of speed
(when using compilers which don't support 'inline').

Bruno





reply via email to

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