[augeas-devel] Warnings as error flag
David Lutterkort
lutter at redhat.com
Tue Aug 17 15:48:57 UTC 2010
On Tue, 2010-08-17 at 10:53 -0400, Francis Giraldeau wrote:
> Hi,
>
> I tried to compile with the autogen option
> --enable-compile-warnings=error and I got an error:
>
> [...]
> CC lens.lo
> cc1: warnings being treated as errors
> lens.c: In function ‘rtn_dot’:
> lens.c:1324: error: unused parameter ‘stage’
>
> But, here is the excerpt code from lens.c from master branch:
>
> [...]
> static void rtn_dot(struct rtn *rtn, const char *stage) {
> FILE *fp;
> int r = 0;
>
> fp = debug_fopen("rtn_%s_%s.dot", stage,
> lens_type_names[rtn->lens_type]);
> [...]
>
> The variable "stage" is read in debug_fopen, so it's used. I don't get
> the point, does somebody have an idea?
Weird ... looks like a compiler bug to me. To work arround it, you could
mark stage in the function prototype with ATTRIBUTE_UNUSED; but the real
solution is to figure out what's tripping gcc up here.
David
More information about the augeas-devel
mailing list