diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-05-25 02:35:34 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-05-25 02:35:34 +0000 |
commit | b264702bd95b455b52261f148f30aaff065d898f (patch) | |
tree | 87f50c36258cf3748cb32abad6a314f28acfef3e | |
parent | 2815e1a075c74143a0b60a632090ece1dffa5c7c (diff) |
Release notes update for -Wsometimes-uninitialized.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157459 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | docs/ReleaseNotes.html | 37 | ||||
-rw-r--r-- | www/content.css | 2 |
2 files changed, 37 insertions, 2 deletions
diff --git a/docs/ReleaseNotes.html b/docs/ReleaseNotes.html index badde05154..8f30808f04 100644 --- a/docs/ReleaseNotes.html +++ b/docs/ReleaseNotes.html @@ -83,9 +83,42 @@ Release Notes</a>.</h1> <h3 id="majorfeatures">Major New Features</h3> <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> -<h4 id="majorfeature1">Feature 1</h4> +<h4 id="diagnostics">Improvements to Clang's diagnostics</h4> + +<p>Clang's diagnostics are constantly being improved to catch more issues, +explain them more clearly, and provide more accurate source information about +them. The improvements since the 3.1 release include:</p> + +<ul> + <li><tt>-Wuninitialized</tt> has been taught to recognise uninitialized uses + which always occur when an explicitly-written non-constant condition is either + <tt>true</tt> or <tt>false</tt>. For example: + +<pre> +int f(bool b) { + int n; + if (b) + n = 1; + return n; +} + +<b>sometimes-uninit.cpp:5:10: <span class="warning">warning:</span> variable 'n' is sometimes uninitialized when used here [-Wsometimes-uninitialized]</b> + return n; + <span class="caret">^</span> +<b>sometimes-uninit.cpp:3:7: <span class="note">note:</span></b> uninitialized use occurs whenever 'if' condition is false + if (b) + <span class="caret">^</span> +<b>sometimes-uninit.cpp:2:8: <span class="note">note:</span></b> initialize the variable 'n' to silence this warning + int n; + <span class="caret">^</span> + <span class="caret"> = 0</span> +</pre> + + This functionality can be enabled or disabled separately from + <tt>-Wuninitialized</tt> with the <tt>-Wsometimes-uninitialized</tt> warning + flag.</li> +</ul> -<p>...</p> <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> <h3 id="cchanges">C Language Changes in Clang</h3> diff --git a/www/content.css b/www/content.css index 574b98e12b..b5925560b1 100644 --- a/www/content.css +++ b/www/content.css @@ -24,6 +24,8 @@ IMG.img_slide { .itemTitle { color:#2d58b7 } span.error { color:red } +span.warning { color:purple } +span.note { color:gray } span.caret { color:green; font-weight:bold } /* Tables */ |