Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Oct 1996 17:13:24 -0600 (MDT)
From:      Nate Williams <nate@mt.sri.com>
To:        "Eric J. Chet" <ejc@gargoyle.bazzle.com>
Cc:        Nate Williams <nate@mt.sri.com>, hackers@freebsd.org
Subject:   Re: C++ question
Message-ID:  <199610172313.RAA21461@rocky.mt.sri.com>
In-Reply-To: <Pine.BSF.3.95.961017184808.22111A-100000@gargoyle.bazzle.com>
References:  <199610172119.PAA20617@rocky.mt.sri.com> <Pine.BSF.3.95.961017184808.22111A-100000@gargoyle.bazzle.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Eric J. Chet writes:
> On Thu, 17 Oct 1996, Nate Williams wrote:
> 
> > Any C++ gurus out here?  If so, here's a small snippet of a program that
> > I am having some questions on.
> > 
> > #if __GNUC__
> > foo::A *               // G++ requires this, but Sun's compiler gets lost
> > #else
> > A *                    // I prefer G++'s syntax above, but can't for Sun
> > #endif
> > 
> > foo::getint(void)
> 
> Remember "A" only exists in foo's namespace.  The declaration
> has to be:
> 
> 	foo::A* foo::getint(void)
> 
> If the Sun compiler allows:
> 
> 	A* foo::getint(void)
> 
> it has a problem.  Sun's compiler should return something like
> "A* is undefined".  

Agreed.  I should submit a bug to them, but I don't know where to submit
it to. ;(

> > The above snippet of code compiles fine with g++ and *all* warnings
> > turned on, but gives the following warning with Sun's CC compiler
> > (latest released version).
> > 
> > fly:/tmp % CC +w -c grpdgram.cc
> > "grpdgram.cc", line 12: Warning (Anachronism): foo::A is not accessible from foo::B.
> 
> This is false, foo::A has been defined and is in the same
> namespace as foo::B.

I agree.

> > It's only a warning, but according to the documentation I'm doing
> > something that won't be allowed in future C++ releases. 
> 
> I have not seen anything disallowing this in the latest public C++
> draft. You can take a look at it: "http://www.cygnus.com/misc/wp/draft"

Thanks for the pointer.

[ The rest taken offline ]


Nate



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610172313.RAA21461>