Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!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: Fri, 13 May 2011 12:08:46 -0500 Message-ID: <4DCD65A2.4FD0@mindspring.com> Date: Fri, 13 May 2011 13:08:50 -0400 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c Subject: Re: macro conventions References: <4dcd62ab$0$23874$bbae4d71@news.suddenlink.net> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Lines: 44 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.154.219.178 X-Trace: sv3-asxKqh/hS9TzC+APvRH0SRTczt8YTAlUpPTV46obICmqvO3VyCetdcenNpVWOszExOw0J9uvnMicBUa!bzWV2vo/luMyeWwTSlYAvAiraXNUlFkWm1xUFZOQEoZyma99DFkp7gn7ip/yJMgRhyhqW5ESFIvr!f+X9qbAf6w0= 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: 2349 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c:3907 Bill Cunningham wrote: > > In defining macros it is of course proper style > to use all caps for > example: > > #define AVG 14 > > There are other conventions too. In trying to learn what is the > diference in having one underscore and two underscores > in front of or behine a macro? For example: > > #define __FILE__ > > Two underscores if front of and behind the define. And here: > > #define _GNU_SOURCE > > One underscore in front and no underscores at the end. > I hope this is clear. > I want to be sure of these things. The more important thing, is to realise that your C implementation uses some macro conventions which you are not supposed to use. Macros with leading underscores are an example of that. ISO/IEC 9899:1999 (E) 7.1.3 Reserved identifiers 1 Each header declares or defines all identifiers listed in its associated subclause, and optionally declares or defines identifiers listed in its associated future library directions subclause and identifiers which are always reserved either for any use or for use as file scope identifiers. — All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use. -- pete