__gnu_cxx::stdio_filebuf constructor

Jonathan Wakely cow@compsoc.man.ac.uk
Tue May 18 16:44:00 GMT 2004


On Thu, May 06, 2004 at 09:53:02AM -0700, David Carlton wrote:

> When upgrading from GCC 3.2.3 to GCC 3.4.0, I noticed that you'd
> changed the __gnu_cxx::stdio_filebuf constructor to get rid of the
> 'del' argument.  The comment above ~stdio_filebuf(), however, still
> refers to that argument, making it hard for me to figure out if the
> new behavior is the same as if del=true or del=false!  Looking at the
> patch in bug 11691, it looks like the behavior is the same as del=true
> (which is the behavior I want, fortunately), but you might want to
> update the comment in the header file accordingly.

Sorry for the delay in replying.

Yes, the fd ctor now always behaves as though del=true was given.

The attached patch updates the comments in include/ext/stdio_filebuf.h

I'll check it in to 3.4 and mainline shortly.

2004-05-18  Jonathan Wakely  <redi@gcc.gnu.org>

	* include/ext/stdio_filebuf.h: Update comments to reflect PR 11691.


> I was also confused by the fact that the only documentation I found
> for this on the GCC web site (admittedly, I didn't look _that_ hard)
> was the doxygen-generated documentation, which is several months old,
> and reflects the old interface.  Perhaps it should be updated to
> reflect the current status of libstdc++?

Yes, those docs are a bit old, it'd be good to have the 3.4 pages up.
Phil?

jon

-- 
http://c2.com/cgi/wiki?NeverExplain
-------------- next part --------------
Index: include/ext/stdio_filebuf.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/ext/stdio_filebuf.h,v
retrieving revision 1.16
diff -u -p -b -B -r1.16 stdio_filebuf.h
--- include/ext/stdio_filebuf.h	9 Dec 2003 04:31:53 -0000	1.16
+++ include/ext/stdio_filebuf.h	18 May 2004 16:38:01 -0000
@@ -68,7 +68,8 @@ namespace __gnu_cxx
        *  @param  size  Optimal or preferred size of internal buffer, in chars.
        *
        *  This constructor associates a file stream buffer with an open
-       *  POSIX file descriptor.
+       *  POSIX file descriptor. The file descriptor will be automatically
+       *  closed when the stdio_filebuf is closed/destroyed.
       */
       stdio_filebuf(int __fd, std::ios_base::openmode __mode,
 		    size_t __size = static_cast<size_t>(BUFSIZ));
@@ -87,8 +88,8 @@ namespace __gnu_cxx
 		    size_t __size = static_cast<size_t>(BUFSIZ));
 
       /**
-       *  Possibly closes the external data stream, in the case of the file
-       *  descriptor constructor and @c del @c == @c true.
+       *  Closes the external data stream if the file descriptor constructor
+       *  was used.
       */
       virtual
       ~stdio_filebuf();


More information about the Libstdc++ mailing list