• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/toolchains/hndtools-armeabi-2011.09/share/doc/arm-arm-none-eabi/html/cpp/
1<html lang="en">
2<head>
3<title>Traditional warnings - The C Preprocessor</title>
4<meta http-equiv="Content-Type" content="text/html">
5<meta name="description" content="The C Preprocessor">
6<meta name="generator" content="makeinfo 4.13">
7<link title="Top" rel="start" href="index.html#Top">
8<link rel="up" href="Traditional-Mode.html#Traditional-Mode" title="Traditional Mode">
9<link rel="prev" href="Traditional-miscellany.html#Traditional-miscellany" title="Traditional miscellany">
10<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
11<!--
12Copyright (C) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
131997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
142008, 2009, 2010, 2011
15Free Software Foundation, Inc.
16
17Permission is granted to copy, distribute and/or modify this document
18under the terms of the GNU Free Documentation License, Version 1.3 or
19any later version published by the Free Software Foundation.  A copy of
20the license is included in the
21section entitled ``GNU Free Documentation License''.
22
23This manual contains no Invariant Sections.  The Front-Cover Texts are
24(a) (see below), and the Back-Cover Texts are (b) (see below).
25
26(a) The FSF's Front-Cover Text is:
27
28     A GNU Manual
29
30(b) The FSF's Back-Cover Text is:
31
32     You have freedom to copy and modify this GNU Manual, like GNU
33     software.  Copies published by the Free Software Foundation raise
34     funds for GNU development.
35-->
36<meta http-equiv="Content-Style-Type" content="text/css">
37<style type="text/css"><!--
38  pre.display { font-family:inherit }
39  pre.format  { font-family:inherit }
40  pre.smalldisplay { font-family:inherit; font-size:smaller }
41  pre.smallformat  { font-family:inherit; font-size:smaller }
42  pre.smallexample { font-size:smaller }
43  pre.smalllisp    { font-size:smaller }
44  span.sc    { font-variant:small-caps }
45  span.roman { font-family:serif; font-weight:normal; } 
46  span.sansserif { font-family:sans-serif; font-weight:normal; } 
47--></style>
48<link rel="stylesheet" type="text/css" href="../cs.css">
49</head>
50<body>
51<div class="node">
52<a name="Traditional-warnings"></a>
53<p>
54Previous:&nbsp;<a rel="previous" accesskey="p" href="Traditional-miscellany.html#Traditional-miscellany">Traditional miscellany</a>,
55Up:&nbsp;<a rel="up" accesskey="u" href="Traditional-Mode.html#Traditional-Mode">Traditional Mode</a>
56<hr>
57</div>
58
59<h3 class="section">10.4 Traditional warnings</h3>
60
61<p>You can request warnings about features that did not exist, or worked
62differently, in traditional C with the <samp><span class="option">-Wtraditional</span></samp> option. 
63GCC does not warn about features of ISO C which you must use when you
64are using a conforming compiler, such as the &lsquo;<samp><span class="samp">#</span></samp>&rsquo; and &lsquo;<samp><span class="samp">##</span></samp>&rsquo;
65operators.
66
67   <p>Presently <samp><span class="option">-Wtraditional</span></samp> warns about:
68
69     <ul>
70<li>Macro parameters that appear within string literals in the macro body. 
71In traditional C macro replacement takes place within string literals,
72but does not in ISO C.
73
74     <li>In traditional C, some preprocessor directives did not exist. 
75Traditional preprocessors would only consider a line to be a directive
76if the &lsquo;<samp><span class="samp">#</span></samp>&rsquo; appeared in column 1 on the line.  Therefore
77<samp><span class="option">-Wtraditional</span></samp> warns about directives that traditional C
78understands but would ignore because the &lsquo;<samp><span class="samp">#</span></samp>&rsquo; does not appear as the
79first character on the line.  It also suggests you hide directives like
80&lsquo;<samp><span class="samp">#pragma</span></samp>&rsquo; not understood by traditional C by indenting them.  Some
81traditional implementations would not recognize &lsquo;<samp><span class="samp">#elif</span></samp>&rsquo;, so it
82suggests avoiding it altogether.
83
84     <li>A function-like macro that appears without an argument list.  In some
85traditional preprocessors this was an error.  In ISO C it merely means
86that the macro is not expanded.
87
88     <li>The unary plus operator.  This did not exist in traditional C.
89
90     <li>The &lsquo;<samp><span class="samp">U</span></samp>&rsquo; and &lsquo;<samp><span class="samp">LL</span></samp>&rsquo; integer constant suffixes, which were not
91available in traditional C.  (Traditional C does support the &lsquo;<samp><span class="samp">L</span></samp>&rsquo;
92suffix for simple long integer constants.)  You are not warned about
93uses of these suffixes in macros defined in system headers.  For
94instance, <code>UINT_MAX</code> may well be defined as <code>4294967295U</code>, but
95you will not be warned if you use <code>UINT_MAX</code>.
96
97     <p>You can usually avoid the warning, and the related warning about
98constants which are so large that they are unsigned, by writing the
99integer constant in question in hexadecimal, with no U suffix.  Take
100care, though, because this gives the wrong result in exotic cases. 
101</ul>
102
103   </body></html>
104
105