[Top][All Lists]
[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.
- error: redefinition of 'struct option',
Bruce Korb <=
- Re: error: redefinition of 'struct option', Eric Blake, 2010/02/17
- Re: error: redefinition of 'struct option', Bruce Korb, 2010/02/18
- Re: error: redefinition of 'struct option', Bruno Haible, 2010/02/18
- Re: error: redefinition of 'struct option', Bruce Korb, 2010/02/18
- Re: error: redefinition of 'struct option', Bruce Korb, 2010/02/18
- Re: error: redefinition of 'struct option', Bruno Haible, 2010/02/18
- Re: error: redefinition of 'struct option', Bruce Korb, 2010/02/18
- new gnulib-tool option --find, Bruno Haible, 2010/02/19
- Re: error: redefinition of 'struct option', Bruce Korb, 2010/02/18
- Re: error after adding #includes to config.h, Bruno Haible, 2010/02/18