[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::c_plus_plus

Title:C++
Notice:Read 1.* and use keywords (e.g. SHOW KEY/FULL KIT_CXX_VAX_VMS)
Moderator:DECCXX::AMARTIN
Created:Fri Nov 06 1987
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3604
Total number of notes:18242

3504.0. "ACCVIO CXX 5.5-017 AXP VMS anonymous union compiler crash" by COMICS::EDWARDSN (Dulce et decorum est pro PDP program) Wed Mar 19 1997 14:40

Here's a bit of code for you which ACCVIO's the 5.5-017 and 015 CXX compilers on 
AXP, but doesn't if either of FIX1 or FIX2 is defined.
Is it meant to work, is it meant to be throwing an error out, but crashes
before it can get the error message out or am I missing something.

Neil 

#ifdef FIX1
# define S1NAME s1
# define S2NAME s2
#else
# define S1NAME
# define S2NAME
#endif

struct quad
{
   union
   {
      struct
      {
         unsigned long lo;
         unsigned long hi;
      } S1NAME;

      struct
      {
         unsigned short w[4];
      } S2NAME;
   };
};

#ifndef FIX2
static quad qone  = {1, 0};
#endif

int main( int argc, char *argv[] )
{
    quad myquad;
#ifndef FIX2
    myquad = qone;
#endif
}
$ cxx 52994
%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=000000000000
0010, PC=000000000016CAF4, PS=0000001B
%TRACE-F-TRACEBACK, symbolic stack dump follows
  image    module    routine             line      rel PC           abs PC
 CXX$COMPILER                               0 000000000015CAF4 000000000016CAF4
 CXX$COMPILER                               0 00000000001A8580 00000000001B8580
 CXX$COMPILER                               0 00000000001A7150 00000000001B7150
 CXX$COMPILER                               0 00000000001A9F3C 00000000001B9F3C
 CXX$COMPILER                               0 0000000000192490 00000000001A2490
 CXX$COMPILER                               0 00000000001A23A8 00000000001B23A8
 CXX$COMPILER                               0 0000000000150790 0000000000160790
 CXX$COMPILER  GEM_CP_VMS  GEM_CP_MAIN   2509 00000000000015C4 000000000027EFB4
                                            0 FFFFFFFF82B190D8 FFFFFFFF82B190D8
$ cxx 52994/define=fix1
$ cxx 52994/define=fix2

T.RTitleUserPersonal
Name
DateLines
3504.1DECC::FOLTANThu Mar 20 1997 14:4729
I can reproduced the problem with C++ V5.5-017.
The problem is fixed in the development stream for 
our next major release.  Below are the following 
error diagnostics that were generated.   I will 
track this problem.

Lois


cxx: Warning: /usr/proj/gem_c/foltan/work/cpp3504.cxx, line 13: declaration does
 not declare anything
      struct
------^
cxx: Warning: /usr/proj/gem_c/foltan/work/cpp3504.cxx, line 19: declaration does
 not declare anything
      struct
------^
cxx: Error: /usr/proj/gem_c/foltan/work/cpp3504.cxx, line 27: no suitable constr
uctor exists to convert from "int" to "union quad::<unnamed>"
static quad qone  = {1, 0};
---------------------^
cxx: Error: /usr/proj/gem_c/foltan/work/cpp3504.cxx, line 27: too many initializ
er values
static quad qone  = {1, 0};
------------------------^
2 errors detected in the compilation of "/usr/proj/gem_c/foltan/work/cpp3504.cxx
".