bug-gnulib
[Top][All Lists]
Advanced

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

error: redefinition of 'struct option'


From: Bruce Korb
Subject: error: redefinition of 'struct option'
Date: Wed, 17 Feb 2010 18:03:23 -0800
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

make[3]: Entering directory `/old-home/gnu/proj/sharutils-bld/lib'
make[4]: Entering directory `/old-home/gnu/proj/sharutils-bld/lib'
gcc -DHAVE_CONFIG_H -I. -I..     -g -Wall -MT close-hook.o -MD -MP -MF 
.deps/close-hook.Tpo -c -o close-hook.o close-hook.c
In file included from ./xstrtol.h:22,
                 from ../config.h:1469,
                 from close-hook.c:18:
./getopt.h:195: error: redefinition of 'struct option'

================

The preprocessed source contains this text:

> # 106 "/usr/include/getopt.h" 3 4
> struct option
> {
>   const char *name;
> 
> 
>   int has_arg;
>   int *flag;
>   int val;
> };
> [............]
> # 194 "./getopt.h" 3
> struct option
> {
>   const char *name;
> 
> 
>   int has_arg;
>   int *flag;
>   int val;
> };

=================== Oops.

The *un*preprocessed gnulib-installed getopt.h has this:

> #ifndef _GL_GETOPT_H
> 
> #if __GNUC__ >= 3
> #pragma GCC system_header
> #endif
> 
> /* The include_next requires a split double-inclusion guard.  We must
>    also inform the replacement unistd.h to not recursively use
>    <getopt.h>; our definitions will be present soon enough.  */
> #if 1
> # define _GL_SYSTEM_GETOPT
> # include_next <getopt.h>
> # undef _GL_SYSTEM_GETOPT
> #endif
> 
> #ifndef _GL_GETOPT_H

That looks wrong to me.  I guess the include_next will
define _GL_GETOPT_H sometimes if _GL_SYSTEM_GETOPT is defined.
OK.  Whatever.  The problem is that I'm getting "struct option"
defined twice.  The second "#ifndef _GL_GETOPT_H" should be trained
to cope with a valid getopt.h that doesn't understand _GL_SYSTEM_GETOPT.

============================

Suggestions, please?  Thank you.




reply via email to

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