source: trunk/third/gcc/README.TRAD @ 8834

Revision 8834, 1.9 KB checked in by ghudson, 28 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r8833, which included commits to RCS files with non-trunk default branches.
Line 
1This is a partial list of how `gcc -traditional' disagrees with
2traditional C compilers (perhaps only some of them).  Most of these
3differences are not bugs.
4
5---------------------------------------------------------------------------
6K&R-1 (2.4.3) says:
7
8        "If the character following a backslash is not one of those
9        specified {in the table above}, the backslash is ignored."
10
11Up until recently, `gcc -traditional' complained about \x \a and \v
12appearing in a character or string literal.  I believe however that
13this non-feature has been eliminated (recently).
14
15---------------------------------------------------------------------------
16When in -traditional mode, gcc allows the following erroneous pair of
17declarations to appear together in a given scope:
18
19        typedef int foo;
20        typedef foo foo;
21
22---------------------------------------------------------------------------
23K&R-1 (8.5) says:
24
25        "No field may be wider than a word."
26
27Gcc however allows:
28
29        struct S { int i:33; };
30
31---------------------------------------------------------------------------
32In K&R-1 there is no restriction against comments crossing include file
33boundaries.  Gcc however doesn't allow this, even when in -traditional mode.
34
35---------------------------------------------------------------------------
36Regarding the length of identifiers, K&R-1 (2.2) says:
37
38        "No more than the first eight characters are significant,
39        although more may be used."
40
41Gcc treats all characters of identifiers as significant, even when in
42-traditional mode.
43
44---------------------------------------------------------------------------
45K&R-1 (2.2) says:
46
47        "An identifier is a sequence of letters and digits; the first
48        character must be a letter.  The underscore _ counts as a letter."
49
50Gcc also allows dollar signs in identifiers.  (This may also be an issue
51for the -pedantic option.)
52
53---------------------------------------------------------------------------
54
55
Note: See TracBrowser for help on using the repository browser.