Message 58

Re: 15-721: scan.o in libwithout.a?

X-Added: With Flames (bblib $Revision: 1.4 $)
Return-path: <deepay@cs.cmu.edu>
X-Andrew-Authenticated-as: 0;andrew.cmu.edu;Network-Mail
Received: from po0.andrew.cmu.edu via trymail for bb+academic.cs.15-721@andrew.cmu.edu
          ID </afs/andrew.cmu.edu/usr0/bb/Mailbox/cvk:82S00UdY5:o057>;
          Sun,  7 Oct 2001 14:42:10 -0400 (EDT)
Received: from mx1.andrew.cmu.edu (MX1.ANDREW.CMU.EDU [128.2.10.111])
        by po0.andrew.cmu.edu (8.9.3/8.9.3) with ESMTP id OAA19144
        for <bb+academic.cs.15-721@ams.andrew.cmu.edu>; Sun, 7 Oct 2001 14:42:09 -0400 (EDT)
Received: from snapdragon.cald.cs.cmu.edu (SNAPDRAGON.CALD.CS.CMU.EDU [128.2.191.164])
        by mx1.andrew.cmu.edu (8.12.0.Beta16/8.12.0.Beta16) with SMTP id f97Ig8eD006291
        for <bb+academic.cs.15-721@andrew.cmu.edu>; Sun, 7 Oct 2001 14:42:08 -0400
Received: from snapdragon.cald.cs.cmu.edu by snapdragon.cald.cs.cmu.edu
          id aa09273; 7 Oct 2001 14:41 EDT
Date: Sun, 7 Oct 2001 14:41:58 -0400 (EDT)
From: Deepayan Chakrabarti <deepay@cs.cmu.edu>
X-Sender: deepay@snapdragon.cald.cs.cmu.edu
To: Spiros Papadimitriou <spapadim+@cs.cmu.edu>
cc: bb+academic.cs.15-721@andrew.cmu.edu
Subject: Re: 15-721: scan.o in libwithout.a?
In-Reply-To: <3BBF995C.5050506@cs.cmu.edu>
Message-ID: <Pine.LNX.3.95L.1011007143700.9266A-100000@snapdragon.cald.cs.cmu.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

Ummm... i tried that, and it still accesses the functions in scan.o
When we return from openScan, perhaps the MyScan* gets casted to the
normal Scan*, and from then on, the MyScan functions never get called...
or perhaps i am doing something wrong in my implementation. but it doesnt
seem so... i did exactly what your mail says. i am not very comfortable w/
C++, so i dont know what the problem could be...

  and oh, just on the side, i got a "Compiler error: Report bug to GNU"
sort of stuff while compiling :) That doesnt happen everyday :) but then,
C++ sucks, so its not really a surprise ;-)

 -deepay 



 On Sat, 6 Oct 2001, Spiros Papadimitriou wrote:

> Yes, that is right...  I mentioned this in a previous email--in more
> detail, the suggested workaround is for you to do sth like:
> 
> class HeapFile {
>   friend class MyScan;
>   // ...
> };
> 
> class MyScan : public Scan {
>     // Implement public methods, completely
>     // shadowing(and ignoring) Scan
>     // ...
> }
> 
> Scan *HeapFile::openScan (Status &s) {
>    MyScan *rval = new MyScan (...);
>    // ...
>    return rval;
> }
> 
> If scan.o wasn't in there, you'd actually have to declare all private
> members in Scan in your class (and to add more you'd have to
> modify the declaration of class Scan {...} so...).  It is ugly, but... :-)
> Hope this helps!
> 
> Spiros
> 
> Bartosz Przydatek wrote:
> 
> >Hi!
> >
> >Apparently, the library libwithout.a contains also object code 
> >for the Scan class (scan.o), which seems to disturb the linker,
> >since it conflicts with our implementation of Scan-methods.
> >How should we proceed with it?
> >
> >Thanx,
> >
> >- Bartosz.
> >
> >
> 
> 
> 
> 
>