tndb z -Werror -Wall

Paweł A. Gajda mis w pld.org.pl
Śro, 19 Lut 2003, 21:19:48 CET


środa 19/02/2003 13:22:07, Artur Frysiak:
> On Wed, Feb 19, 2003 at 01:03:54PM +0100, Paweł A. Gajda wrote:
> > 
> > AFAIK jest to dozwolone i dość często stosowane; no i mój gcc się 
> > nie pluje...; podrzuć log z kompilacji może coś się da wyguglać. 
> > 
> 
> if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.   -Werror -Wall -I./../trurlib/include/ -Wall -W -g -O2 -MT read.lo -MD -MP -MF ".deps/read.Tpo" \
>   -c -o read.lo `test -f 'read.c' || echo './'`read.c; \
> then mv ".deps/read.Tpo" ".deps/read.Plo"; \
> else rm -f ".deps/read.Tpo"; exit 1; \
> fi
>  gcc -DHAVE_CONFIG_H -I. -I. -I. -Werror -Wall -I./../trurlib/include/ -Wall -W -g -O2 -MT read.lo -MD -MP -MF .deps/read.Tpo -c read.c  -fPIC -DPIC -o .libs/read.o
> read.c:362: conflicting types for `tndb_open'
> tndb.h:44: previous declaration of `tndb_open'
> read.c:368: conflicting types for `tndb_dopen'

IMVHO coś masz popsute. Z draftu standardu ANSI C:
(http://std.dkuug.dk/JTC1/SC22/WG14/www/docs/n843.htm)

      If a type specifier of the form

               struct-or-union identifier
       or
               enum identifier

       occurs  other  than as part of one of the above forms, and a
       declaration of the identifier as a tag is visible,  then  it
       specifies  the same type as that other declaration, and does
       not redeclare the tag.

W tym przypadku (o ile dobrze rozumiem) "declaration of 
the identifier as a tag is visible"

Ciekawym dlaczego ta sama wersja gcc zachowuje się inaczej, mógłbyś 
podrzucić mi wyjście z "gcc ... -E read.c"? Może coś jest powalone 
z Twoimi kopiami nagłówków, czy coś...

W każdym razie, te poprawki które podesłałeś pomagają? 




Więcej informacji o liście dyskusyjnej pld-installer