Initial revision
[official-gcc.git] / gcc / README.TRAD
blob07ccd16437b138cd8689ccff0daa7ad8b0cad380
1 This is a partial list of how `gcc -traditional' disagrees with
2 traditional C compilers (perhaps only some of them).  Most of these
3 differences are not bugs.
5 ---------------------------------------------------------------------------
6 K&R-1 (2.4.3) says:
8         "If the character following a backslash is not one of those
9         specified {in the table above}, the backslash is ignored."
11 Up until recently, `gcc -traditional' complained about \x \a and \v
12 appearing in a character or string literal.  I believe however that
13 this non-feature has been eliminated (recently).
15 ---------------------------------------------------------------------------
16 When in -traditional mode, gcc allows the following erroneous pair of
17 declarations to appear together in a given scope:
19         typedef int foo;
20         typedef foo foo;
22 ---------------------------------------------------------------------------
23 K&R-1 (8.5) says:
25         "No field may be wider than a word."
27 Gcc however allows:
29         struct S { int i:33; };
31 ---------------------------------------------------------------------------
32 In K&R-1 there is no restriction against comments crossing include file
33 boundaries.  Gcc however doesn't allow this, even when in -traditional mode.
35 ---------------------------------------------------------------------------
36 Regarding the length of identifiers, K&R-1 (2.2) says:
38         "No more than the first eight characters are significant,
39         although more may be used."
41 Gcc treats all characters of identifiers as significant, even when in
42 -traditional mode.
44 ---------------------------------------------------------------------------
45 K&R-1 (2.2) says:
47         "An identifier is a sequence of letters and digits; the first
48         character must be a letter.  The underscore _ counts as a letter."
50 Gcc also allows dollar signs in identifiers.  (This may also be an issue
51 for the -pedantic option.)
53 ---------------------------------------------------------------------------