Discussion in 'C Programming' started by Bill Cunningham, May 1, 2014.

  1. Why on my system is fpos_t 128 bit? And long and long long are 64 bit
    while int is 32 bit. Is fpos_t an alias for some struct type of some kind?
    man fpos_t shows nothing so I don't know if it has a man page. Is fpos_t a
    typedef or something?

    Bill Cunningham, May 1, 2014
    1. Advertisements

  2. Bill Cunningham

    Ian Collins Guest

    How do you know?
    Find the definition in your system headers.
    Ian Collins, May 1, 2014
    1. Advertisements

  3. I am tempted to ask why you are surprised by this but I am not sure that
    would help anyone. On my system, it is made up of a file position and a
    piece of data used to record the state of any multibyte character
    encoding that might be in force.
    Almost certainly. The C standard says that is must be a complete
    non-array object type, and that means is it very often a struct type.
    Yes, it's a typedef.
    Ben Bacarisse, May 1, 2014
  4. If it's not written as a macro.
    Bill Cunningham, May 1, 2014
  5. I can't find a structs elements anywhere. I am assuming this would begin
    then with:

    typedef struct... so on.
    Bill Cunningham, May 1, 2014
  6. Why do you care? Surely you are not planning to try to manipulate its
    internal components directly?

    Does man size_t show anything on your system? What about man FILE?
    What would you expect a man page to say about a type that is
    deliberately opaque?
    Where are you looking? What is the text you are searching for?

    fpos_t is a type that is declared in stdio.h. What do you find when
    you search stdio.h for fpos_t?
    Barry Schwarz, May 1, 2014
  7. Bill Cunningham

    James Kuyper Guest

    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.
    James Kuyper, May 1, 2014
  8. It's not in stddef.h either that I can see. I don't know about stdarg.h
    Bill Cunningham, May 1, 2014
  9. I wanted to see them.
    It's 216 bytes! I think I might see it.
    Bill Cunningham, May 1, 2014
  10. 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.
    Keith Thompson, May 1, 2014
  11. Bill Cunningham

    Ken Brody Guest

    On the IDE I use, I can simply right-click on "fpos_t" and select "show
    definition", and the IDE will open the proper header file and highlight the
    Ken Brody, May 1, 2014
  12. Bill Cunningham

    Phil Carmody Guest

    [SNIP - usual trollery]

    Stop fucking morphing. (It looks like 5 lines in my scorefile
    with that general name now, if that isn't proof he's a troll
    I don't know what is.)

    And will you twonks stop bloody feeding him?

    Phil Carmody, Jun 2, 2014
  13. Bill Cunningham

    Kaz Kylheku Guest

    How is he morphing? The "Bill Cunningham" spelling has not changed in
    a decade and a half.

    Stop fucking matching on the <...> part of the From: line!
    Kaz Kylheku, Jun 2, 2014
  14. Bill Cunningham

    Ike Naar Guest

    Apparently you haven't noticed that it recently called itself
    "Bill Cunningaham <>" (watch the extra 'a').
    Ike Naar, Jun 2, 2014
  15. Bill Cunningham

    David Brown Guest

    That's probably a typo on his part.

    "Never attribute to malice that which can be equally well explained by
    David Brown, Jun 3, 2014
  16. Bill Cunningham

    James Kuyper Guest

    That probably also applies to his use of .
    James Kuyper, Jun 3, 2014
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads