🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #203

Problems porting code to g++ 2.2.2

#203
From: James A. Crotinger
Date: Tue, 28 Jul 1992 19:11
51 lines
2599 bytes
  I recently built and installed gcc 2.2.2 on a SparcStation and I'm
having some problems porting some code which works fine using Sun C++
(and numerous other CFRONT implementations).

  Problem #1: 
    g++ doesn't appear to support the "placement" syntax for operator
    new():

                 new(addr) T;

    where "addr" is supposed to specify the address at which the
    resulting object(s) will be located. I seem to recall that older
    versions of g++ had a different syntax for doing this, but I can't
    recall what it is. What is the rationale for not supporting the
    above anyway?

  Problem #2:
    We have a "generic" matrix class for which we defined a
    variable argument list constructor of the form

       Matrix(TYPE)::Matrix(TYPE)(int i, int j, TYPE first, ...)

    which uses stdarg.h to initialize the matrix from the values
    passed in. gcc will not compile this if TYPE has a constructor.
    For instance, when TYPE == SCLComplex (which has a constructor),
    it gives the following messages:

      ComplexMat.cc:137: \
        warning: cannot pass objects of type `SCLComplex' through `...'
      ComplexMat.cc:137: \
        member `d' with constructor or destructor not allowed in union

    Is what we're trying to do illegal? Or is this just a limitation
    of g++?

  Problem #3:
    We compile the GNU regular expression code with C++.  When I try
    to do this with g++, it gets a segmentation violation in cc1plus.
    If I rename the file from GNURegex.cc to GNURegex.c, so that it
    compiles with the C compiler, it compiles fine (although it does
    give three warnings about prototypes for strlen, abort, and exit
    not being consistent with the "builtin" ones).  Thus I can get by,
    but it bothers me that g++ can't compile this file.

  Jim

--
-------------------------------------------------/\--------------------------
James A. Crotinger     Lawrence Livermore N'Lab // \ The above views are mine
jac@moonshine.llnl.gov P.O. Box 808;  L-630 \\ //---\  and are not neces-
(510) 422-0259         Livermore CA  94550   \\/Amiga\  sarily those of LLNL.
Technical Details
Message-ID: <jac.712350715@moonshine>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!moonshine.llnl.gov!jac

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!moonshine.llnl.gov!jac
From: jac@moonshine.llnl.gov (James A. Crotinger)
Subject: Problems porting code to g++ 2.2.2
Message-ID: <jac.712350715@moonshine>
Sender: gnulists@ai.mit.edu
Organization: Magnetic Fusion Energy - LLNL
Distribution: gnu
Date: Tue, 28 Jul 1992 19:11:55 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 52