<ftream> errors under g++ 3.2.2

From: Allan Bowhill (abowhill_at_blarg.net)
Date: 06/29/03

  • Next message: Ruslan Ermilov: "Re: latest -CURRENT buildworld fails - 17:30PDT June 8, 2003"
    To: "fbsd-current" <freebsd-current@freebsd.org>
    Date: Sun, 29 Jun 2003 11:19:02 -0700
    
    

    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?

    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?

    (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"


  • Next message: Ruslan Ermilov: "Re: latest -CURRENT buildworld fails - 17:30PDT June 8, 2003"

    Relevant Pages

    • 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)
    • Re: HPGCC Questions ladies and gentlemen!!!
      ... No matter how you slice it in order to compile a C program you need to know ... it took a few hours just to get gcc running in my computer ... of the students that used an ide in the c++ class I took a few years ago. ... so why not use a data inspector if it's available? ...
      (comp.sys.hp48)
    • Re: Linux C++ compiler
      ... This product only works using some version of dos though source code written in it I've found usually ports well into gcc. ... These are very inexpensive and come with very good documentation. ... Functions have half of the Power C manual and each function is documented with a worked example so you can key the worked example in and compile it and see how that function works on a computer system. ...
      (comp.os.msdos.djgpp)
    • Re: Aquarius prolog so fast?
      ... Mercury cannot do all this because Mercury cannot keep track of the fact ... you need this capability quite rarely, ... Why not the alternative GCC back-end, ... While Mercury can compile to the internal data structures of the gcc backend, ...
      (comp.lang.prolog)
    • Re: Question about gcc on OS X 10.0.4.11 Tiger
      ... running Linux and gcc 4.0.2. ... How do I switch to a different version of gcc to compile with on OS X ... fgetsis a libc function and is not really part of the compiler. ... int main(int argc, char* argv){ ...
      (comp.sys.mac.programmer.help)