This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libstdc++] Document and guard stdio_filebuf.h


On Tue, May 21, 2002 at 01:59:58PM -0700, Mark Mitchell wrote:
> --On Tuesday, May 21, 2002 04:59:10 PM -0400 Phil Edwards <phil@jaj.com> 
> wrote:
> > It also adds multiple inclusion guards.  Since those are not
> > documentation, I'm formally requesting branch approval under rule #2.a
> > from
> >
> >     http://gcc.gnu.org/ml/gcc/2002-05/msg01212.html
> 
> Are there ways to get errors by trying to #include this file more than
> once at present?

Shiver me timbers.  I didn't think there were, but there are.  Using the
current branch compiler:

    29% cat foo.cc

    #include <ext/stdio_filebuf.h>
    #include <ext/stdio_filebuf.h>

    int main() { }

    30% g++ foo.cc
    In file included from foo.cc:3:
    /home/pme/build/install-2002-05-21-3branch/include/g++-v3/ext/stdio_filebuf.h:35: redefinition
       of default argument for `class _Traits'
    /home/pme/build/install-2002-05-21-3branch/include/g++-v3/ext/stdio_filebuf.h:34:
        original definition appeared here
    /home/pme/build/install-2002-05-21-3branch/include/g++-v3/ext/stdio_filebuf.h:36: redefinition
       of `class __gnu_cxx::stdio_filebuf<_CharT, _Traits>'
    /home/pme/build/install-2002-05-21-3branch/include/g++-v3/ext/stdio_filebuf.h:36: previous
       definition of `class __gnu_cxx::stdio_filebuf<_CharT, _Traits>'
    31%

If the second #include is removed, or the patch is applied, compilation
succeeds.


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]