Thread View: borland.public.cppbuilder.database.ado
2 messages
2 total messages
Started by JJ
Fri, 17 Nov 2000 21:44
regression of compilers
Author: JJ
Date: Fri, 17 Nov 2000 21:44
Date: Fri, 17 Nov 2000 21:44
30 lines
1606 bytes
1606 bytes
Has technology become so complex, that compilers can no longer distinguish
fundamental concepts of code?
Aside from Borlands typelib imports not working correctly (C++ Builder 5),
the following is an excerpt showing why a programmer could be left
clueless...
Note: example requires typelib import of ado 2.x
TCOM_Connection cn = CoConnection::Create();
cn->Release();
cn.Release();
Note: compiled using C++Builder 5pro. This example compiles, both can't be
correct.
I would think that perhaps this fails on typelib style objects? Because the
following is interpreted/compiled correctly:
struct A {
int B;
};
A fooA;
A *fooB = new A;
fooA.B = 0;
fooA->B = 0; // compiler error=good
fooB.B = 0; // compiler error=good
fooB->B = 0;
Re: regression of compilers
Author: Relaxin
Date: Mon, 20 Nov 2000 00:42
Date: Mon, 20 Nov 2000 00:42
44 lines
2117 bytes
2117 bytes
Both of these will compile because they are calling different Release
methods.
The pointer reference is calling the Release of the Interface.
The other call to Release is calling the Release method of the
TCOM_Connection class, which then calls the Release of the Interface.
"JJ" <jj@jj> wrote in message news:3a15a6cb_1@dnews...
> Has technology become so complex, that compilers can no longer distinguish
> fundamental concepts of code?
>
> Aside from Borlands typelib imports not working correctly (C++ Builder 5),
> the following is an excerpt showing why a programmer could be left
> clueless...
>
> Note: example requires typelib import of ado 2.x
>
> TCOM_Connection cn = CoConnection::Create();
> cn->Release();
> cn.Release();
>
> Note: compiled using C++Builder 5pro. This example compiles, both can't
be
> correct.
>
> I would think that perhaps this fails on typelib style objects? Because
the
> following is interpreted/compiled correctly:
>
> struct A {
> int B;
> };
>
> A fooA;
> A *fooB = new A;
>
> fooA.B = 0;
> fooA->B = 0; // compiler error=good
> fooB.B = 0; // compiler error=good
> fooB->B = 0;
>
>
>
>
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads