libtool
[Top][All Lists]
Advanced

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

RE: Problem with ltdl.h


From: Bernard Dautrevaux
Subject: RE: Problem with ltdl.h
Date: Wed, 29 Nov 2000 10:38:34 +0100

> -----Original Message-----
> From: Alexandre Oliva [mailto:address@hidden
> Sent: Tuesday, November 28, 2000 11:53 PM
> To: Kevin Atkinson
> Cc: address@hidden
> Subject: Re: Problem with ltdl.h
> 
> 
> On Nov 28, 2000, Kevin Atkinson <address@hidden> wrote:
> 
> > On 28 Nov 2000, Alexandre Oliva wrote:
> >> On Nov 28, 2000, Bernard Dautrevaux 
> <address@hidden> wrote:
> >> 
> >> > in C++
> >> >  struct lt_dlhandle
> >> > automatically define a TYPENAME i.e. makes an implicit
> >> >  typedef struct lt_dlhandle lt_dlhandle;
> >> 
> >> However, IIRC, it is valid to have the implicit name overridden by
> >> another definition of the name, which is what the `typedef' does.
> 
> > So are you saying that you are not going to fix it.
> 
> Not really.  I'm just asking for better arguments to make me change my
> mind about it :-)
> 
> > It does NOT appear
> > to be valid C++ code
> 
> I've just managed to compile:
> 
> typedef struct foo foo;
> 
> with g++, version 2.95.2.  So it *is* valid C++.  I don't understand
> why G++ is complaining about it.

YES! this is valid; what's NOT is

typedef struct foo* foo;
                  ^_______ notice the '*' there.

canopus{SoftWrks}: echo "typedef struct foo* foo;" > tst.cpp
canopus{SoftWrks}: gcc -c tst.cpp
tst.cpp:1: conflicting types for `typedef struct foo * foo'
tst.cpp:1: previous declaration as `struct foo'
canopus{SoftWrks}: 

> 
> If some widely used C++ compiler fails to compile it, for example,
> when ltdl.h is in its standard header-file search path, then we may
> have a good reason to change it.  But first I want to understand the
> problem, so that it can at least be documented.

ALL C++ comilers should choke on this. AND as I say in my previous mail it
is VERY misleading to typedef a pointer to something with the same name as
this something.

Of course, as I've also said earlier, I don't have the latest CVS libtool,
so I take for granted what the initial message said, that is the offending
code is
    typedef struct lt_dlhandle *lt_dlhandle;

If there is no '*', all is OK of course.


        Bernard

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:    +33 (0) 1 47 68 80 80
Fax:    +33 (0) 1 47 88 97 85
e-mail: address@hidden
                address@hidden
-------------------------------------------- 



reply via email to

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