Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #9971

Re: FILE type

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: FILE type
Date 2011-09-06 14:39 -0700
Organization None to speak of
Message-ID <lnliu1pcyk.fsf@nuthaus.mib.org> (permalink)
References <4e6666b7$0$31779$426a74cc@news.free.fr>

Show all headers | View raw


yoxoman <invalid@invalid.invalid> writes:
> Is there a reason why the FILE type (from stdio) is written uppercase ? 
> Is it related to its opaque nature ?

Macros are conventionally written in all-caps.

I'm not sure of this, but it's possible that the FILE type was first
introduced when typedef had not yet been added to the language.
If so, the original definition might have been something like:

    struct __file_info {
        /* ... */
    };
    #define FILE struct __file_info

In modern C it has to be a typedef (there's no permission to define
it as a macro), but the name stuck.

Another distinct possibility is that whoever invented the name
just thought putting it in all-caps would be a good idea.  The C
standard library is not noted for being 100% consistent.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

FILE type yoxoman <invalid@invalid.invalid> - 2011-09-06 18:30 +0000
  Re: FILE type Jonathan Leffler <jleffler@earthlink.net> - 2011-09-06 14:39 -0700
  Re: FILE type Keith Thompson <kst-u@mib.org> - 2011-09-06 14:39 -0700
    Re: FILE type pete <pfiland@mindspring.com> - 2011-09-06 18:49 -0400
      Re: FILE type DDD <1983ddd@gmail.com> - 2011-09-06 22:02 -0700
        Re: FILE type Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-09-07 03:12 -0700
          Re: FILE type gwowen <gwowen@gmail.com> - 2011-09-07 05:25 -0700

csiph-web