DragonFly BSD
DragonFly bugs List (threaded) for 2005-08
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: include files bug?


From: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Tue, 16 Aug 2005 15:54:49 +0200
Mail-followup-to: bugs@crater.dragonflybsd.org

On Tue, Aug 16, 2005 at 02:28:47PM +0200, Simon 'corecode' Schubert wrote:
> Where does the standard say something about the (claimed by joerg) fact 
> that FILEs may not be instanciated (except by libc) or copied, nor 
> their size taken?

ISO C99 specifies:
7.19.3 Files (6): The address of the FILE object used to control a
stream may be significant; a copy of a FILE object need not to serve in
place of the original.
7.19.1 Introduction (2):
The types declared are ... FILE which is an object type capable of
recording all the information needed to control a stream, including its
file position indicator, a pointer to its associated buffer (if any), an
error indicator that records whether a read/write error has occured, and
an end-of-file indicator that records whether the end of the file has
been reached.

The important part is that neither the layout nor any operations on FILE
are specified. The only operations available are on FILE *. I don't
claim that ISO C99 says that they might not be instanciated or their
size taken. But it also doesn't specify that this operations are
allowed. My point is that they don't make sense, because if we would
return a value for sizeof() or allow the instanciation, the resulting
FILE object would still be completely useless.

Joerg



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]