home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / g / bug / 2064 < prev    next >
Encoding:
Text File  |  1992-12-22  |  4.2 KB  |  137 lines

  1. Newsgroups: gnu.g++.bug
  2. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cygnus.com!mrs
  3. From: mrs@cygnus.com (Mike Stump)
  4. Subject: Re:  HP Snake-specific bug with forward-declared inline functions
  5. Message-ID: <9212212113.AA13653@cygnus.com>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Mon, 21 Dec 1992 21:13:09 GMT
  10. Approved: bug-g++@prep.ai.mit.edu
  11. Lines: 124
  12.  
  13. This problem has been fixed, and should not exist in the next release of gcc.
  14.  
  15. > Date: Mon, 24 Aug 92 18:14:43 PDT
  16. > From: jbuck@ohm.berkeley.edu (Joe Buck)
  17. > Message-Id: <9208250114.AA28409@ohm.Berkeley.EDU>
  18. > To: bug-g++@prep.ai.mit.edu
  19.  
  20. > For the following program, g++ 2.2.2 emits a reference to an
  21. > undefined label, causing the assembler to fail, on the HP Snake
  22. > (configure hp720-hpux).
  23.  
  24. > The error occurs only with optimization on.  It occurs for the Snake
  25. > but not for Sparc or DecStation platforms.  Here is the -v output:
  26. > ------------------------------------------------------------------------
  27. > % g++ -v -O -c tt.cc
  28. > g++ -v -O -c tt.cc 
  29. > Reading specs from /ohm3/users/messer/hp-gnu/lib/gcc-lib/hp720-hpux/2.2.2/specs
  30. > gcc version 2.2.2
  31. >  /ohm3/users/messer/hp-gnu/lib/gcc-lib/hp720-hpux/2.2.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -D_HPUX_SOURCE -D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__ -D__PWB__ -D__hpux__ -D__unix__ -D___HPUX_SOURCE__ -D__hppa -D__hp9000s800 -D__hp9000s800 -D__hp9k8 -D__PWB -D__hpux -D__unix -D___HPUX_SOURCE -D__OPTIMIZE__ tt.cc /usr/tmp/cca20455.i
  32. > GNU CPP version 2.2.2 (hp9000s800)
  33. >  /ohm3/users/messer/hp-gnu/lib/gcc-lib/hp720-hpux/2.2.2/cc1plus /usr/tmp/cca20455.i -quiet -dumpbase tt.cc -O -version -o /usr/tmp/cca20455.s
  34. > GNU C++ version 2.2.2 (hp9000s800) compiled by GNU C version 2.2.2.
  35. >  as -o tt.o /usr/tmp/cca20455.s
  36. > as: [err#7403]
  37. >   undefined label - haltRequested__10SimControl (7403)
  38. > /ohm3/users/messer/hp-gnu/bin/gcc: tt.o: No such file or directory
  39. > ------------------------------------------------------------------------
  40.  
  41. > Here is the input, used above as tt.cc.  It is a preprocessor output.
  42. > Removing the "#" lines removes the error.
  43.  
  44. > ------------------------------------------------------------------------
  45. > # 1 "t.cc"
  46. > # 1 "SimControl.h" 1
  47.  
  48. > #pragma interface
  49.  
  50. > class Star;
  51. > class SimAction;
  52. > class SimActionList;
  53. > typedef void (*SimActionFunction)(Star*,const char*);
  54. > typedef int (*SimHandlerFunction)();
  55.  
  56. > class SimControl {
  57. >     friend class SimControlOwner;
  58. > public:
  59. >     enum flag_bit {
  60. >         halt = 1,
  61. >         error = 2,
  62. >         interrupt = 4,
  63. >         poll = 8 };
  64. >      
  65. >     static int doPreActions(Star * which) {
  66. >         return (nPre > 0) ? internalDoActions(preList,which)
  67. >             : !haltRequested();
  68. >     }
  69.  
  70. >     static int doPostActions(Star * which) {
  71. >         return (nPost > 0) ? internalDoActions(postList,which)
  72. >             : !haltRequested();
  73. >     }
  74. >      
  75. >     static SimAction* registerAction(SimActionFunction action, int pre,
  76. >                    const char* textArg = 0, Star* which = 0);
  77.  
  78. >     static SimHandlerFunction setInterrupt(SimHandlerFunction f) {
  79. >         SimHandlerFunction ret = onInt;
  80. >         onInt = f;
  81. >         return ret;
  82. >     }
  83.  
  84. >     static SimHandlerFunction setPoll(SimHandlerFunction f) {
  85. >         SimHandlerFunction ret = onPoll;
  86. >         onPoll = f;
  87. >         flags |= poll;
  88. >         return ret;
  89. >     }
  90.  
  91. >     static int cancel(SimAction*);
  92.  
  93. >     static void requestHalt () {
  94. >         flags |= halt;
  95. >     }
  96. >     static void declareErrorHalt () {
  97. >         flags |= (error|halt);
  98. >     }
  99. >     static void clearHalt () {
  100. >         flags = 0;
  101. >     }
  102.  
  103. >     static int haltRequested () {
  104. >         if (flags != 0) processFlags();
  105. >         return haltStatus();
  106. >     }
  107.  
  108. >     static unsigned int flagValues() { return flags;}
  109.  
  110. >     static void catchInt(int signo = -1, int always = 0);
  111.  
  112. > private:
  113. >     static int haltStatus () {
  114. >         return (flags & halt) != 0;
  115. >     }
  116.  
  117. >     static void intCatcher(int);
  118.  
  119. >     static void processFlags();
  120. >     static int internalDoActions(SimActionList*,Star*);
  121.  
  122. >     static SimActionList * preList;
  123. >     static SimActionList * postList;
  124. >     static unsigned int flags;
  125. >     static int nPre, nPost;
  126. >     static SimHandlerFunction onInt, onPoll;
  127. > };
  128.  
  129. > # 1 "t.cc" 2
  130.  
  131.  
  132. > int fire() {
  133. >     if (!SimControl::doPreActions(0)) return 0 ;
  134. >     else return SimControl::doPostActions(0);
  135. > }
  136.  
  137.