bug-gnulib
[Top][All Lists]
Advanced

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

Re: warning: module to simplify adding compiler warnings


From: Simon Josefsson
Subject: Re: warning: module to simplify adding compiler warnings
Date: Tue, 11 Nov 2008 16:01:23 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

Paolo Bonzini <address@hidden> writes:

> Simon Josefsson wrote:
>> Paolo Bonzini <address@hidden> writes:
>> 
>>>> But gl_WARN_INIT should also accept a VARIABLE argument, then? Or better,
>>>> make gl_WARN_INIT automatic upon the first use of gl_WARN_ADD with the
>>>> given VARIABLE?
>>> You have a point; however, gl_WARN_INIT would then need a second
>>> argument for the description too, and then the user can directly use
>>> AC_ARG_VAR.
>> 
>> For that reason, I'd be in favor of requiring a gl_WARN_INIT for each
>> variable used.  That might avoid strange effects due to typos too.
>
> I'm not sure all users want to use AC_ARG_VAR for every warning
> variable.

Good point.  Still, making it possible for users to use the same idiom
to add all warning flags might be useful?  That would allow something
like:

gl_WARN_INIT(WARN_CFLAGS, [C Compiler warning flags])
gl_WARN_INIT(WARN_FOO_CFLAGS, [Extra C Compiler warning flags for foo])

gl_WARN_ADD(-Wbar)
gl_WARN_ADD(-Wfoo, WARN_FOO_CFLAGS)
gl_WARN_ADD(-Wapa, WARN_OTHER_INTERNAL_CFLAGS)

Maybe presence of a comment should decide whether to use AC_ARG_VAR on
it?  E.g. the first block would then be:

gl_WARN_INIT(WARN_CFLAGS, [C Compiler warning flags])
gl_WARN_INIT(WARN_FOO_CFLAGS, [Extra C Compiler warning flags for foo])
gl_WARN_INIT(WARN_OTHER_INTERNAL_CFLAGS)

The gl_WARN_INIT code would invoke AC_ARG_VAR on the first and second
variable, but not the last.

/Simon




reply via email to

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