Re: huffman encoder
- From: "Chuck F. " <cbfalconer@xxxxxxxxx>
- Date: Fri, 23 Dec 2005 08:26:59 -0500
Martin Vejnar wrote:
Flash Gordon wrote:aarklon@xxxxxxxxx wrote:
that is a header file can be set up in the following lines
/*things.h*/
#ifndef _THINGS__H_
>>> #define _THINGS_H_ >>> /*rest of include file*/ >>> #endif
People may do this, but it is definitely and categorically WRONG. All identifiers starting with an underscore followed by an upper case letter are reserved for the implementation. You should not ever use them unless you are using some implementation specific extension and the documentation for your implementation EXPLICITLY tells you to use one, and then you should only use it as your implementation says and reallise that the code is completely non-portable.
I agree that using underscore at the beginning of anything is a bad idea. But I think that the Standard actually neither prohibits nor discourages this.
I don't have the latest version of the Standard or I might have interpreted it incorrectly, so it is fairly possible that I'm wrong. If that's the case, please prove me wrong. All quotations of the Standard are from "Committee Draft - August 3, 1998".
The Standard clearly distinguishes between `identifier`s and `macro name`s. What you're reffering to is actually not an identifier. It's a macro name.
[7.1.3 #1] -- All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use. -- All identifiers that begin with an underscore are always reserved for use as identifiers with file scope in both the ordinary and tag name spaces.
So yes, the Standard indeed marks these *identifiers* as reserved. There is no such clause for macro names except the following:
[6.10.8] [#4] None of these macro names(1), nor the identifier defined, shall be the subject of a #define or a #undef preprocessing directive. Any other predefined macro names shall begin with a leading underscore followed by an uppercase letter or a second underscore.
From N869, clearly contradicting your assertion above:
6.2 Concepts
6.2.1 Scopes of identifiers
[#1] An identifier can denote an object; a function; a tag or a member of a structure, union, or enumeration; a typedef name; a label name; a macro name; or a macro parameter. The same identifier can denote different entities at different points in the program. A member of an enumeration is called an enumeration constant. Macro names and macro parameters are not considered further here, because prior to the semantic phase of program translation any occurrences of macro names in the source file are replaced by the preprocessing token sequences that constitute their macro definitions.
-- Some informative links: news:news.announce.newusers http://www.geocities.com/nnqweb/ http://www.catb.org/~esr/faqs/smart-questions.html http://www.caliburn.nl/topposting.html http://www.netmeister.org/news/learn2quote.html
.
- References:
- huffman encoder
- From: aarklon
- Re: huffman encoder
- From: Martin Ambuhl
- Re: huffman encoder
- From: aarklon
- Re: huffman encoder
- From: Flash Gordon
- huffman encoder
- Prev by Date: Re: Reverse a string "in place"
- Next by Date: Re: o/p problem
- Previous by thread: Re: huffman encoder
- Next by thread: Re: huffman encoder
- Index(es):
Relevant Pages
|