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


Groups > comp.lang.c > #4079

Re: macro conventions

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: macro conventions
Date 2011-05-16 08:43 -0700
Organization None to speak of
Message-ID <lniptafy7p.fsf@nuthaus.mib.org> (permalink)
References <4dcd62ab$0$23874$bbae4d71@news.suddenlink.net> <gjpqs69uh0h50ssjml2upma865bo90epav@4ax.com> <lnboz4gji9.fsf@nuthaus.mib.org> <ipg1t69sdqlusla40v1curmctr0lpgchu0@4ax.com>

Show all headers | View raw


ralph <nt_consulting64@yahoo.net> writes:
> On Sun, 15 May 2011 06:50:54 -0700, Keith Thompson <kst-u@mib.org>
> wrote:
[...]
>>TO be clear, it's leading underscores that should be avoided.  FOO_BAR,
>>for example, is perfectly ok.  Trailing underscores are also ok, though
>>I wouldn't use them without a good reason.
>
> Thanks for that catch. I did make it sound like underscores should be
> avoided throughout an identifier, when they are in fact OK. 
>
> It should also be amplified that double underscores "_ _" are reserved
> even within or trailing an identifier
>
>      FOO_BAR is OK, FOO__BAR or FOOBAR__ is not.
[...]

No, they aren't.  I think C++ reserves idenifiers with double
underscores (so they can be used for name mangling, if I recall
correctly), but C doesn't.

Still, it certainly couldn't hurt to avoid double underscores in
C code.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Nokia
"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

macro conventions "Bill Cunningham" <nospam@nspam.invalid> - 2011-05-13 12:56 -0400
  Re: macro conventions pete <pfiland@mindspring.com> - 2011-05-13 13:08 -0400
  Re: macro conventions Shao Miller <sha0.miller@gmail.com> - 2011-05-13 13:14 -0400
    Re: macro conventions Keith Thompson <kst-u@mib.org> - 2011-05-13 11:41 -0700
      Re: macro conventions "Bill Cunningham" <nospam@nspam.invalid> - 2011-05-14 23:08 -0400
  Re: macro conventions ralph <nt_consulting64@yahoo.net> - 2011-05-13 13:15 -0500
    Re: macro conventions "Bill Cunningham" <nospam@nspam.invalid> - 2011-05-14 23:11 -0400
    Re: macro conventions "Bill Cunningham" <nospam@nspam.invalid> - 2011-05-15 04:00 -0400
      Re: macro conventions Angel <angel+news@spamcop.net> - 2011-05-15 11:15 +0000
        Re: macro conventions Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-05-16 04:36 +0300
          Re: macro conventions Ike Naar <ike@sverige.freeshell.org> - 2011-05-16 09:56 +0000
            Re: macro conventions Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-05-16 19:00 +0300
            Re: macro conventions Seebs <usenet-nospam@seebs.net> - 2011-05-16 19:10 +0000
              Re: macro conventions Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-05-22 21:27 +0300
    Re: macro conventions Keith Thompson <kst-u@mib.org> - 2011-05-15 06:50 -0700
      Re: macro conventions Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-05-15 08:29 -0700
        Re: macro conventions Ian Collins <ian-news@hotmail.com> - 2011-05-16 07:40 +1200
          Re: macro conventions "osmium" <r124c4u102@comcast.net> - 2011-05-15 14:52 -0500
      Re: macro conventions ralph <nt_consulting64@yahoo.net> - 2011-05-16 02:22 -0500
        Re: macro conventions Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-05-16 14:18 +0100
          Re: macro conventions David Resnick <lndresnick@gmail.com> - 2011-05-16 08:03 -0700
            Re: macro conventions Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-05-16 17:32 +0100
        Re: macro conventions Keith Thompson <kst-u@mib.org> - 2011-05-16 08:43 -0700
          Re: macro conventions Michael Press <rubrum@pacbell.net> - 2011-05-16 14:47 -0700

csiph-web