S
Seebs
It was recently pointed out that the theoretical construct:
struct __file;
typedef struct __file FILE;
is not a conforming implementation (assuming no definition of struct __file),
because FILE is specified to be an object type.
However!
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 serve in place of the
original.
So.
typedef unsigned char FILE;
If the address is significant (it must be the address of the beginning of
some object of undisclosed nature), this allows me to refer to an arbitrarily
complex item through a "FILE *", assures me that I can represent the address
of any such item in a "FILE *", and hides the implementation details.
Am I missing anything? (I mean, apart from the implicit performance hit from
not being able to do some things as macros...)
-s
struct __file;
typedef struct __file FILE;
is not a conforming implementation (assuming no definition of struct __file),
because FILE is specified to be an object type.
However!
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 serve in place of the
original.
So.
typedef unsigned char FILE;
If the address is significant (it must be the address of the beginning of
some object of undisclosed nature), this allows me to refer to an arbitrarily
complex item through a "FILE *", assures me that I can represent the address
of any such item in a "FILE *", and hides the implementation details.
Am I missing anything? (I mean, apart from the implicit performance hit from
not being able to do some things as macros...)
-s