From mboxrd@z Thu Jan 1 00:00:00 1970
Return-Path:
Received: (qmail 24929 invoked by alias); 15 Jan 2020 18:51:49 -0000
Mailing-List: contact gcc-cvs-wwwdocs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id:
List-Archive:
List-Post:
List-Help:
Sender: gcc-cvs-wwwdocs-owner@gcc.gnu.org
Received: (qmail 24867 invoked by uid 10054); 15 Jan 2020 18:51:49 -0000
Date: Wed, 15 Jan 2020 18:51:00 -0000
Message-ID: <20200115185149.24864.qmail@sourceware.org>
From: wilco@gcc.gnu.org
To: gcc-cvs-wwwdocs@gcc.gnu.org
Subject: gcc-wwwdocs branch master updated. 75712dd8e232984cc6eb7dc9aee1aeddfb54bbe7
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 2c7ec979b25dcea145daa4c490c12925ea9d2487
X-Git-Newrev: 75712dd8e232984cc6eb7dc9aee1aeddfb54bbe7
X-SW-Source: 2020/txt/msg00031.txt
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gcc-wwwdocs".
The branch, master has been updated
via 75712dd8e232984cc6eb7dc9aee1aeddfb54bbe7 (commit)
from 2c7ec979b25dcea145daa4c490c12925ea9d2487 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 75712dd8e232984cc6eb7dc9aee1aeddfb54bbe7
Author: Wilco Dijkstra
Date: Fri Nov 29 12:48:15 2019 +0000
Document -fcommon default change
diff --git a/htdocs/gcc-10/changes.html b/htdocs/gcc-10/changes.html
index 8e72bd4..5c25195 100644
--- a/htdocs/gcc-10/changes.html
+++ b/htdocs/gcc-10/changes.html
@@ -140,6 +140,13 @@ a work-in-progress.
In C2X mode, -fno-fp-int-builtin-inexact
is
enabled by default.
+
+ GCC now defaults to -fno-common
. As a result, global
+ variable accesses are more efficient on various targets. In C, global
+ variables with multiple tentative definitions now result in linker errors.
+ With -fcommon
such definitions are silently merged during
+ linking.
+
C++
diff --git a/htdocs/gcc-10/porting_to.html b/htdocs/gcc-10/porting_to.html
index 3256e8a..7d45a96 100644
--- a/htdocs/gcc-10/porting_to.html
+++ b/htdocs/gcc-10/porting_to.html
@@ -29,9 +29,25 @@ and provide solutions. Let us know if you have suggestions for improvements!
Preprocessor issues
-->
-
+
+Default to -fno-common
+
+
+ A common mistake in C is omitting extern
when declaring a global
+ variable in a header file. If the header is included by several files it
+ results in multiple definitions of the same variable. In previous GCC
+ versions this error is ignored. GCC 10 defaults to -fno-common
,
+ which means a linker error will now be reported.
+ To fix this, use extern
in header files when declaring global
+ variables, and ensure each global is defined in exactly one C file.
+ As a workaround, legacy C code can be compiled with -fcommon
.
+
+
+ int x; // tentative definition - avoid in header files
+
+ extern int y; // correct declaration in a header file
+
Fortran language issues
-----------------------------------------------------------------------
Summary of changes:
htdocs/gcc-10/changes.html | 7 +++++++
htdocs/gcc-10/porting_to.html | 20 ++++++++++++++++++--
2 files changed, 25 insertions(+), 2 deletions(-)
hooks/post-receive
--
gcc-wwwdocs