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


Groups > comp.lang.c > #28714

Re: what is the best way

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date Tue, 27 Nov 2012 22:48:28 -0600
Message-ID <50B5979D.7F60@mindspring.com> (permalink)
Date Tue, 27 Nov 2012 23:48:29 -0500
From pete <pfiland@mindspring.com>
Reply-To pfiland@mindspring.com
Organization PF
X-Mailer Mozilla 3.04Gold (WinNT; I)
MIME-Version 1.0
Newsgroups comp.lang.c
Subject Re: what is the best way
References <50b4d9fc$0$3108$ba620e4c@news.skynet.be> <k931s6$jk1$1@dont-email.me> <lna9u2jz7c.fsf@nuthaus.mib.org>
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Lines 53
X-Usenet-Provider http://www.giganews.com
NNTP-Posting-Host 4.154.220.227
X-Trace sv3-GcjfgBs4jegJhdsVTG4GgnB3qIX9uDZn+1UYoSl11jGmhWnKCmHmlTTQ0XwE9R1pVG4lNMR0hIBTEuY!OBSmSi71aPfQFwYtvuqsxLYJtWwyb4nYn2YGe6dFL0kjt9u0IzO+l/UHmGDVB867MKvYKJU548xk!e1zuYAXH4wY=
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 2454
X-Received-Bytes 2595
Xref csiph.com comp.lang.c:28714

Show key headers only | View raw


Keith Thompson wrote:
> 
> Les Cargill <lcargill99@comcast.com> writes:
> [...]
> > - Have this basic structure:
> >
> > thing.h:
> >
> > #ifndef _THING_H_
> > #define _THING_H_ 1
> > ...
> > #endif
> >
> > guarding all header files.
> [...]
> 
> Identifiers starting with an underscore and an uppercase letter
> (or with two underscores) are reserved to the implementation for
> any use; in other words, you should never use such identifiers in
> your own code.
> 
> Just use this:
> 
> #ifndef THING_H
> #define THING_H
> ...
> #endif /* THING_H */
> 
> (or some scheme that maps reasonably well from file names to
> identifiers without stepping on anything that's reserved).
> 
> Note that identifiers starting with E and either a digit or an
> uppercase letter may be used for implementation-defined macros
> in <errno.h>, so a header name that happens to start with E might
> cause problems.  One way to avoid that is:
> 
> #ifndef H_THING
> #define H_THING
> ...
> #endif /* H_THING */
> 
> It's not terribly likely that an implementation is going to use
> _THING_H_ or EXTRA_FOO for its own purposes, so you can very likely
> get away with using such identifiers yourself, but if you avoid
> reserved identifiers you have one less thing to worry about.

I use

#ifndef H_THING_H
#define H_THING_H

-- 
pete

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


Thread

what is the best way Andre <pas.mois@ailleur.be> - 2012-11-27 16:19 +0100
  Re: what is the best way Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-11-27 15:35 +0000
  Re: what is the best way Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-11-27 08:59 -0800
  Re: what is the best way James Kuyper <jameskuyper@verizon.net> - 2012-11-27 13:14 -0500
    Re: what is the best way Ian Collins <ian-news@hotmail.com> - 2012-11-28 08:43 +1300
      Re: what is the best way James Kuyper <jameskuyper@verizon.net> - 2012-11-27 15:02 -0500
        Re: what is the best way Ian Collins <ian-news@hotmail.com> - 2012-11-28 09:29 +1300
  Re: what is the best way Les Cargill <lcargill99@comcast.com> - 2012-11-27 12:48 -0600
    Re: what is the best way Ian Collins <ian-news@hotmail.com> - 2012-11-28 08:56 +1300
      Re: what is the best way Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-11-27 22:19 +0000
        Re: what is the best way Les Cargill <lcargill99@comcast.com> - 2012-11-27 18:21 -0600
          Re: what is the best way Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-11-28 05:08 -0800
            Re: what is the best way Les Cargill <lcargill99@comcast.com> - 2012-11-28 12:43 -0600
      Re: what is the best way Les Cargill <lcargill99@comcast.com> - 2012-11-27 18:15 -0600
        Re: what is the best way Ian Collins <ian-news@hotmail.com> - 2012-11-28 14:21 +1300
          Re: what is the best way Les Cargill <lcargill99@comcast.com> - 2012-11-27 20:06 -0600
            Re: what is the best way Ian Collins <ian-news@hotmail.com> - 2012-11-28 15:21 +1300
              Re: what is the best way Les Cargill <lcargill99@comcast.com> - 2012-11-27 20:31 -0600
              Re: what is the best way glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-11-28 04:00 +0000
              Re: what is the best way Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-11-28 05:17 -0800
                Re: what is the best way Ian Collins <ian-news@hotmail.com> - 2012-11-29 08:30 +1300
                Re: what is the best way Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-11-29 05:47 -0800
                Re: what is the best way Ian Collins <ian-news@hotmail.com> - 2012-11-30 07:37 +1300
                Re: what is the best way Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-11-29 11:35 -0800
    Re: what is the best way Keith Thompson <kst-u@mib.org> - 2012-11-27 17:25 -0800
      Re: what is the best way Les Cargill <lcargill99@comcast.com> - 2012-11-27 20:15 -0600
      Re: what is the best way pete <pfiland@mindspring.com> - 2012-11-27 23:48 -0500
    Re: what is the best way Sergio Durigan Junior <sergiodj@riseup.net> - 2012-11-28 03:06 -0200
      Re: what is the best way pete <pfiland@mindspring.com> - 2012-11-28 01:35 -0500
  Re: what is the best way pete <pfiland@mindspring.com> - 2012-11-28 00:13 -0500

csiph-web