Valid header names
c, c++
Solution
It's referring to this:
There shall be an implementation-defined mapping between the delimited sequence and the external source file name. The implementation shall provide unique mappings for sequences consisting of one or more letters (as defined in $2.2.1) followed by a period (.) and a single letter. The implementation may ignore the distinctions of alphabetical case and restrict the mapping to six significant characters before the period.
(C89)
This is the C99 version:
The implementation shall provide unique mappings for sequences consisting of one or more letters or digits (as defined in 5.2.1) followed by a period (.) and a single letter. The first character shall be a letter. The implementation may ignore the distinctions of alphabetical case and restrict the mapping to eight significant characters before the period.
Problem
I can't understand correctly what does they mean in the following article: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1566.htm It is interesting to note that C89 explicitly allowed only letters in header and include file names. C++ added underscores, and C99 added digits. Probably both standards should allow both. I found the following statements in all C and C++ standards: ISO/IEC 9899:1990 ``` 6.1.7 Header names Syntax 1 header-name: < h-char-sequence > " q-char-sequence " h-char-sequence: h-char h-char-sequence h-char h-char: any member of the source character set except the new-line character and > q-char-sequence: q-char q-char-sequence q-char q-char: any member of the source character set except the new-line character and " ``` ISO/IEC 9899:1990 ``` 5.2.1 Character sets ... Both the basic source and basic execution character sets shall have the following members: the 26 uppercase letters of the Latin alphabet A B C D E F G H I J K L M N O P Q R S T U V W X Y Z the 26 lowercase letters of the Latin alphabet a b c d e f g h i j k l m n o p q r s t u v w x y z the 10 decimal digits 0 1 2 3 4 5 6 7 8 9 the following 29 graphic characters ! " # % & ' ( ) * + , — . / : ; < = > ? [ \ ] ^ _ { | } ~ ``` For example, i see underscore and digits even in C89 / C90.