libtool-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] Cwrapper should not eat -- arguments


From: Olly Betts
Subject: Re: [PATCH] Cwrapper should not eat -- arguments
Date: Wed, 28 May 2008 16:08:07 +0000 (UTC)
User-agent: slrn/0.9.8.1pl1 (Debian)

On 2008-05-25, Charles Wilson <address@hidden> wrote:
> +#define LTWRAPPER_OPTION_PREFIX         "--lt-"
> +#define LTWRAPPER_OPTION_PREFIX_LENGTH  5

If the idea is that the user can change LTWRAPPER_OPTION_PREFIX, then
hard-coding the length risks a mismatch if they fail to update
LTWRAPPER_OPTION_PREFIX_LENGTH as well (or update it incorrectly).

Perhaps this would be better:

#define LTWRAPPER_OPTION_PREFIX_LENGTH (sizeof(LTWRAPPER_OPTION_PREFIX) - 1)

Or if you're worried LTWRAPPER_OPTION_PREFIX might get changed to be a
pointer and want a compile-time error in that case:

#define LTWRAPPER_OPTION_PREFIX_LENGTH (sizeof(LTWRAPPER_OPTION_PREFIX"") - 1)

Cheers,
    Olly





reply via email to

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