public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch][gcc12-changes] Add a new item about the support for automatic static variable initialization
@ 2021-09-28 20:31 Qing Zhao
  2021-09-28 20:39 ` Kees Cook
  2021-09-29 14:42 ` Martin Sebor
  0 siblings, 2 replies; 8+ messages in thread
From: Qing Zhao @ 2021-09-28 20:31 UTC (permalink / raw)
  To: richard Biener; +Cc: gcc-patches Nick Alcock via, kees Cook

Hi,

This is the patch for the gcc12 changes  per your request. 

Kees provided most of the wording. 

Please take a look and let’s know whether it’s good for commit?

thanks.

Qing

================================================


From: qing zhao <qing.zhao@oracle.com>
Date: Tue, 28 Sep 2021 12:01:42 -0700
Subject: [PATCH] gcc-12/changes.html: Uninitialized stack variables
 initialization update

	* htdocs/gcc-12/changes.html (Eliminating uninitialized variables):
	Item about the support for automatic static variable initialization.
---
 htdocs/gcc-12/changes.html | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html
index 1f156a9..8e2979c 100644
--- a/htdocs/gcc-12/changes.html
+++ b/htdocs/gcc-12/changes.html
@@ -245,6 +245,25 @@ a work-in-progress.</p>
 <!-- .................................................................. -->
 <h2>Other significant improvements</h2>
 
+<h3 id="uninitialized">Eliminating uninitialized variables</h3>
+
+<ul>
+  <li>GCC can now initialize all stack variables implicitly, including
+      padding. This is intended to eliminate all classes of uninitialized
+      stack variable flaws. Lack of explicit initialization will still
+      warn when <code>-Wuninitialized</code> is active. For best
+      debugging, use of the new command-line option
+      <code>-ftrivial-auto-var-init=pattern</code> can be used to fill
+      variables with a repeated 0xFE pattern, which tends to illuminate
+      many bugs (e.g. pointers receive invalid addresses, sizes and indices
+      are very large). For best production results, the new command-line
+      option <code>-ftrivial-auto-var-init=zero</code> can be used to
+      fill variables with 0x00, which tends to provide a safer state for
+      bugs (e.g. pointers are NULL, strings are NULL filled, and sizes
+      and indices are 0).
+  </li>
+</ul>
+
 <h3 id="debug">Debugging formats</h3>
 
 <ul>
-- 
1.9.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-09-29 17:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-28 20:31 [patch][gcc12-changes] Add a new item about the support for automatic static variable initialization Qing Zhao
2021-09-28 20:39 ` Kees Cook
2021-09-29 10:39   ` Richard Biener
2021-09-29 14:18     ` Qing Zhao
2021-09-29 14:43       ` Qing Zhao
2021-09-29 17:15         ` Kees Cook
2021-09-29 14:14   ` Qing Zhao
2021-09-29 14:42 ` Martin Sebor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).