🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Paolo Zeppegno Tue, 02 May 1989 16:15
g++ 1.34.2 parameter passing bug
#1935
Author: Paolo Zeppegno
Date: Tue, 02 May 1989 16:15
24 lines
1071 bytes
I'm not c++ guru, but I think the following program should not compile
(for people not familiar with InterViews Banner is a subclass of Interactor)
g++ 1.34.2 compiles this without a warning..

#include <InterViews/world.h>
#include <InterViews/banner.h>

test(Interactor p)
{
    printf("%d\n", sizeof p);
}

main()
{
    Banner *foo = 0;
    printf("%d\n", sizeof *foo);
    test(*foo);
}

g++ version 1.34.2
 /usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dvax -Dunix -D__vax__ -D__unix__ prova.c /tmp/cc003707.cpp
GNU CPP version 1.34
 /usr/local/lib/gcc-c++ /tmp/cc003707.cpp -quiet -dumpbase prova.c -g -version - o /tmp/cc003707.s
GNU C++ version 1.32.0 (vax) compiled by GNU C version 1.34.
g++ 1.34.2 parameter passing bug
#1936
Author: Michael Tiemann
Date: Wed, 03 May 1989 15:17
41 lines
1932 bytes
   Date: 2 May 89 16:15:25 GMT
   From: mcvax!i2unix!semto!paolo@uunet.uu.net  (Paolo Zeppegno)
   Organization: Systems & Management (Torino - Italy)
   Sender: bug-g++-request@prep.ai.mit.edu

   I'm not c++ guru, but I think the following program should not compile
   (for people not familiar with InterViews Banner is a subclass of Interactor)
   g++ 1.34.2 compiles this without a warning..

   #include <InterViews/world.h>
   #include <InterViews/banner.h>

   test(Interactor p)
   {
       printf("%d\n", sizeof p);
   }

   main()
   {
       Banner *foo = 0;
       printf("%d\n", sizeof *foo);
       test(*foo);
   }

   g++ version 1.34.2
    /usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dvax -Dunix -D__vax__ -D__unix__ prova.c /tmp/cc003707.cpp
   GNU CPP version 1.34
    /usr/local/lib/gcc-c++ /tmp/cc003707.cpp -quiet -dumpbase prova.c -g -version - o /tmp/cc003707.s
   GNU C++ version 1.32.0 (vax) compiled by GNU C version 1.34.

First, I claim that it should compile, since you can make an
interactor from a banner, since interactor is a public base class of
banner.  This is a legal, default conversion.

Second, you have the 1.34.2 driver, but the compiler being accessed is
version 1.32.0.  You should run the installation procedure so that the
latest compiler (c++) is accessed by the latest driver (g++).  Then
you should get consistent (1.34, 1.34.2) version numbers.

Michael
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