Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
Release notes update for -Wsometimes-uninitialized.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157459 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
zygoloid committed May 25, 2012
1 parent 2815e1a commit b264702
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
37 changes: 35 additions & 2 deletions docs/ReleaseNotes.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,42 @@ <h2 id="whatsnew">What's New in Clang 3.2?</h2>
<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>
Expand Down
2 changes: 2 additions & 0 deletions www/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit b264702

Please sign in to comment.