🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Paul Vaughan Mon, 04 Dec 1989 22:46
MI bug
#674
Author: Paul Vaughan
Date: Mon, 04 Dec 1989 22:46
192 lines
5743 bytes
The following file produces incorrect output (in my and a few
colleagues estimation), when compiled with

[1.1119]puma) g++-1.36.2 -v -g -o com com.cc
g++ version 1.36.2- (based on GCC 1.36)
 /usr/local/gnu/1.36.2/lib/gcc-cpp -+ -v -undef -D__GNUC__ -D__GNUG__ -D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 com.cc /usr/tmp/cca10913.cpp
GNU CPP version 1.36
 /usr/local/gnu/1.36.2/lib/gcc-cc1plus /usr/tmp/cca10913.cpp -quiet -dumpbase com.cc -g -version -o /usr/tmp/cca10913.s
GNU C++ version 1.36.2- (based on GCC 1.36) (68k, MIT syntax) compiled by GNU C version 1.36.
default target switches: -m68020 -mc68020 -m68881 -mbitfield
com.cc: In method IModel::IModel ():
com.cc:101: warning: function too large to be inline
 /usr/local/gnu/1.36.2/lib/gcc-as -mc68020 -o com.o /usr/tmp/cca10913.s
 /usr/local/gnu/1.36.2/lib/gcc-ld -o com -e start -dc -dp -Bstatic /lib/crt0.o /lib/Mcrt1.o com.o -lg++ /usr/local/gnu/1.36.2/lib/gcc-gnulib -lg -lc

and run on a SUN3.
---------------------------------

#include <stream.h>

class Selection;
class Port;
class Model;
class Simulator;
class PortBehavior;
class AttributeBehavior;
class IModelPort;
struct IModelPortPSLList {};
struct SimUnitpSLList {};
enum PortType {IN, OUT, BI};

class SimUnit {
public:
  SimUnit() {};
  virtual ~SimUnit() {};
  Simulator *simulator;
  Model *model;		
  virtual void error(char*) {};
  virtual void connect(SimUnit*) {};
  virtual void connect(Port*) {};
  virtual void save() {};
  virtual void reset() {};		
  virtual void start() {};		
  virtual void setSimulator(Simulator*) {};
  virtual void inspect() {};	
//private:

};

class Model : public SimUnit {
public:
  void addUnit(SimUnit*) {};	
  void deleteUnit(SimUnit*) {};	
  void addPort(Port*) {};
  void deletePort(Port*) {};


  void reset() {};
  virtual void start() {};
  virtual void printSubUnits() {};
  void setSimulator(Simulator*) {};

  Model() {};
  virtual ~Model() {};

protected:
  SimUnitpSLList subunits; 
};


class Behavior {
  
public:
  
  Behavior() {};
  virtual ~Behavior() {};

  virtual Behavior* GetPart(char*) {};
  virtual void SetIcon(Selection*) {};
  virtual void UnSetIcon(Selection*) {};
  virtual int HaveAttributes() {};
  virtual AttributeBehavior** GetAttributes() {};
  
protected:

  void Warn(char*) {};
  Selection* icon;
};

class PrimitiveBehavior : public Behavior {
public:

  PrimitiveBehavior() {};
  ~PrimitiveBehavior() {};
  
  virtual int AddPortOK(PortType) {};
  virtual char** PortChoices(PortType) {};
  virtual void AddPort(PortBehavior*) {};
  virtual void DeletePort(PortBehavior*) {};
  

};

class ModelBehavior : public PrimitiveBehavior {
public:

  ModelBehavior() {};
  ~ModelBehavior() {};
  
  virtual void AddUnit(PrimitiveBehavior*) {};
  virtual void DeleteUnit(PrimitiveBehavior*) {};
  virtual void AddUnit(ModelBehavior*) {};
  virtual void DeleteUnit(ModelBehavior*) {};

};

class IModel : public ModelBehavior, public Model {
public:
  IModel() {
    cout << "IModel::IModel() this = " << (int) this       << "\n"
	<< " (Behavior*) this = " << (int) (Behavior*) this << "\n"
	  << " &icon = " << (int) &icon << "\n"
	    << " (PrimitiveBehavior*) this = " << (int) (PrimitiveBehavior*) this << "\n"
	      << " (ModelBehavior*) this = " << (int) (ModelBehavior*) this << "\n"
		<< " (SimUnit*) this = " << (int) (SimUnit*) this << "\n"
		  << " &simulator = " << (int) &simulator << "\n"
		  << " &model = " << (int) &model << "\n"
		    << " (Model*) this = " << (int) (Model*) this << "\n"
		      << " &subunits = " << (int) &subunits << "\n"
			<< "----" << "\n"
			  << " &inports = " << (int) &inports << "\n";
  };
  ~IModel() {};
  void AddUnit(PrimitiveBehavior*) {};
  void DeleteUnit(PrimitiveBehavior*) {};
  
  void AddUnit(ModelBehavior*) {};
  void DeleteUnit(ModelBehavior*) {};

  int AddPortOK(PortType) {};
  char** PortChoices(PortType) {};
  void AddPort(PortBehavior*) {};
  void DeletePort(PortBehavior*) {};
  int HaveAttributes() {};
  AttributeBehavior** GetAttributes() {};
  Behavior* GetPart(char*) {};
  void Disconnect(PortBehavior*, Selection*) {};
protected:
  IModelPortPSLList inports;
  IModelPortPSLList outports;
  IModelPortPSLList biports;
  IModelPort* findPort(char*, IModelPortPSLList*) {};
private:
void deletePortList(IModelPortPSLList*) {};
};



main() {
IModel c;
}


----------------------------------
output:


[1.1120]puma) com
IModel::IModel() this = 251657336
 (Behavior*) this = 251657336
 &icon = 251657336
 (PrimitiveBehavior*) this = 251657336
 (ModelBehavior*) this = 251657336
 (SimUnit*) this = 251657344
 &simulator = 251657336
 &model = 251657340
 (Model*) this = 251657344
 &subunits = 251657356
----
 &inports = 251657358



-------------------------------------------

Note that the simulator and model slots are not in a reasonable place.
Everything else seems to be where it belongs.  This is a bad bug--it
cost me about a whole day to locate, identify and isolate from my
application.  It's also holding us back at the moment.  It's
especially onerous because it used to work properly with the 1.36.0-
version.
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