James Kuyper said:
On 05/01/2014 05:33 AM, Barry Schwarz wrote:
It would be more precise to say that it is declared as a result of
#including <stdio.h>. It's possible, and in my experience, commonplace,
for a standard header to #include other files, which do some or all of
the actual work. As a result, Bill might not be able to find it by
merely looking at the one file. He might have to track down the
#includes, which might be too complicated a task for him.
It would also be perfectly conforming for standard headers to be
implemented without the use of standard header files at all, which is
why the standard goes out of it's way to avoid using the term "file"
when talking about them.
If you're curious about how your system defines fpos_t and you
happen to be using gcc, you can do this:
echo '#include <stdio.h>' | gcc -E - | less
and search for "fpos_t". "-E" tells gcc to write the output of
the preprocessor to standard output; "-" tells it to read from
standard input rather than from a source file. "less" is a text
viewing program; if you prefer, you can send the output of gcc to
a temporary file and view the file using your favorite text editor.
Other compilers likely have options to do something similar.
You'll probably have to search for other declarations that are used
in the definition of fpos_t.
Be aware that, in a typical implementation, neither the contents
of the standard headers nor the output of the preprocessor are
designed to be easily human-readable.
This will tell you how your system defines fpos_t. It will *not*
give you any information that any program that uses fpos_t can or
should make use of. All the information you need to *use* fpos_t
can be found in the C standard, namely that it's
a complete object type other than an array type capable of
recording all the information needed to specify uniquely every
position within a file
and that fsetpos() and fgetpos() take an argument of type pointer to
fpos_t. On systems I have access to at the moment, I see fpost_t
defined as an integer type on some and as a struct on others.