Re: <ftream> errors under g++ 3.2.2

From: Patrick Hartling (patrick_at_137.org)
Date: 06/29/03

  • Next message: Jeffrey Hsu: "<ftream> errors under g++ 3.2.2"
    Date: Sun, 29 Jun 2003 13:31:39 -0500
    To: Allan Bowhill <abowhill@blarg.net>
    
    

    Allan Bowhill wrote:
    > I recently updated one of my machines to -current to adapt some code to
    > build under the new version of gcc (3.2.2). However, file IO using <fstream>
    > gives error messages about implicit typenames being deprecated, and I can't
    > for the life of me figure out what to do my code to make the compiler happy.
    > Has anyone encountered this?

    I do a lot of C++ development on -current, and I have been seeing these
    exact warnings. The problem is in the fstream header, however, so there
    is nothing you can do to your code to prevent the warnings. You could
    modify /usr/include/g++/fstream to silence the warnings, but it would
    get overwritten if you upgrade your system.

    > Below is a small example illustrating the problem. The source below should
    > compile fine on a previous version of g++, as in -stable. However, it will
    > not compile on -current using g++ 3.3.2. Does anyone know what to do to the
    > simple source below to get it to compile happily under -current?

     From your output, I don't see compile failures, I see warnings. Do you
    have -Werror turned on somewhere that wouldn't show up during normal
    usage--like some environment variable or something? I was able to
    compile and run your code without issue here.

    Honestly, I am surprised that a GCC header would have an implicit
    typename since the compiler clearly complains loudly about them. At any
    rate, I think the update to GCC 3.3 in -current is going to happen quite
    soon, and presumably, the updated GCC C++ headers will have warnings
    such as these fully eliminated.

      -Patrick

    > (yes, I have checked gnu gcc's mailing list and FAQ/docs. I can't find an
    > adequate explanation for it. I suspect it has something to do with stricter
    > conformance to the finalized C++ standard, but since I am still a novice any
    > explanation by gcc developers would probably have slipped by me)
    >
    > ---------
    >
    > #include <fstream>
    >
    > int main()
    > {
    > std::ofstream afile("test.txt");
    > afile << "some data";
    > }
    >
    > ----------
    >
    >
    >>gcc -v
    >
    > Using built-in specs.
    > Configured with: FreeBSD/i386 system compiler
    > Thread model: posix
    > gcc version 3.2.2 [FreeBSD] 20030205 (release)
    >
    > ---------
    >
    >
    >>g++ test.cc
    >
    > In file included from test.cc:1:
    > /usr/include/g++/fstream:304: warning: `typename std::basic_filebuf<_CharT,
    > _Traits>::int_type' is implicitly a typename
    > /usr/include/g++/fstream:304: warning: implicit typename is deprecated,
    > please
    > see the documentation for details
    > /usr/include/g++/fstream:309: warning: `typename std::basic_filebuf<_CharT,
    > _Traits>::int_type' is implicitly a typename
    > /usr/include/g++/fstream:309: warning: implicit typename is deprecated,
    > please
    > see the documentation for details
    >
    > _______________________________________________
    > freebsd-current@freebsd.org mailing list
    > http://lists.freebsd.org/mailman/listinfo/freebsd-current
    > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    >

    -- 
    Patrick L. Hartling                     | Research Assistant, VRAC
    patrick@137.org                         | 2274 Howe Hall Room 2624
    PGP: http://www.137.org/patrick/pgp.txt | T: +1.515.294.4916
    http://www.137.org/patrick/             | http://www.vrac.iastate.edu/
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    

  • Next message: Jeffrey Hsu: "<ftream> errors under g++ 3.2.2"

    Relevant Pages

    • Math::Pari doesnt compile with GCC 3.4.2 in Solaris 9 sparc
      ... I spent a long time trying to compile Math::Pari with no success. ... system is a Solaris 9 sparc, with gcc 3.4.2 and GNU make 3.80. ... Well, I did get a lot of warnings, but it compiled! ... cc1: warning: changing search order for system directory ...
      (comp.lang.perl.modules)
    • Re: Atomic statements execute more than once inside a thread
      ... When compiled with gcc: ... Copyright Microsoft Corp 1984-1998. ... If you're going to use Microsoft Visual C++ to compile C code that you ... Any warnings you get from either of these compilers should be ...
      (comp.lang.c)
    • RE: Where can I obtain the gcc 2.96 RPM, src, or similar?
      ... talk2UtimeSince doing this i've been unable to compile mod_jk into apache. ... Subject: RE: Where can I obtain the gcc 2.96 RPM, src, or similar? ... is a compiler switch to raise the level of the severity of the warnings so ...
      (RedHat)
    • GCC 3.3.1, new warnings with <limits>
      ... If I compile the following program: ... with the following flags: ... I get lots of warnings that did not appear in GCC 3.2: ...
      (freebsd-current)
    • Re: How do I install this missing library?
      ... you really should be carefully following LSTC's installation ... libg2c is part of gcc. ... to tell a newcomer to compile. ... like the source code to GNU tar, and make sure you understand what's ...
      (comp.os.linux.misc)