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

Commit b264702

Browse files
committed
Release notes update for -Wsometimes-uninitialized.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157459 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 2815e1a commit b264702

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

docs/ReleaseNotes.html

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,42 @@ <h2 id="whatsnew">What's New in Clang 3.2?</h2>
8383
<h3 id="majorfeatures">Major New Features</h3>
8484
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
8585

86-
<h4 id="majorfeature1">Feature 1</h4>
86+
<h4 id="diagnostics">Improvements to Clang's diagnostics</h4>
87+
88+
<p>Clang's diagnostics are constantly being improved to catch more issues,
89+
explain them more clearly, and provide more accurate source information about
90+
them. The improvements since the 3.1 release include:</p>
91+
92+
<ul>
93+
<li><tt>-Wuninitialized</tt> has been taught to recognise uninitialized uses
94+
which always occur when an explicitly-written non-constant condition is either
95+
<tt>true</tt> or <tt>false</tt>. For example:
96+
97+
<pre>
98+
int f(bool b) {
99+
int n;
100+
if (b)
101+
n = 1;
102+
return n;
103+
}
104+
105+
<b>sometimes-uninit.cpp:5:10: <span class="warning">warning:</span> variable 'n' is sometimes uninitialized when used here [-Wsometimes-uninitialized]</b>
106+
return n;
107+
<span class="caret">^</span>
108+
<b>sometimes-uninit.cpp:3:7: <span class="note">note:</span></b> uninitialized use occurs whenever 'if' condition is false
109+
if (b)
110+
<span class="caret">^</span>
111+
<b>sometimes-uninit.cpp:2:8: <span class="note">note:</span></b> initialize the variable 'n' to silence this warning
112+
int n;
113+
<span class="caret">^</span>
114+
<span class="caret"> = 0</span>
115+
</pre>
116+
117+
This functionality can be enabled or disabled separately from
118+
<tt>-Wuninitialized</tt> with the <tt>-Wsometimes-uninitialized</tt> warning
119+
flag.</li>
120+
</ul>
87121

88-
<p>...</p>
89122

90123
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
91124
<h3 id="cchanges">C Language Changes in Clang</h3>

www/content.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ IMG.img_slide {
2424
.itemTitle { color:#2d58b7 }
2525

2626
span.error { color:red }
27+
span.warning { color:purple }
28+
span.note { color:gray }
2729
span.caret { color:green; font-weight:bold }
2830

2931
/* Tables */

0 commit comments

Comments
 (0)