public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* [PATCH cygport] Add -Werror=return-type to CXXFLAGS/OBJCXXFLAGS
@ 2021-09-02 17:01 Christian Franke
  0 siblings, 0 replies; only message in thread
From: Christian Franke @ 2021-09-02 17:01 UTC (permalink / raw)
  To: cygwin-apps

[-- Attachment #1: Type: text/plain, Size: 227 bytes --]

Ignoring -Wreturn-type for C++ programs may lead to crashes. C language 
is not affected.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96181
https://sourceware.org/pipermail/cygwin/2021-August/249153.html

Regards,
Christian


[-- Attachment #2: 0001-Add-Werror-return-type-to-CXXFLAGS-OBJCXXFLAGS.patch --]
[-- Type: text/plain, Size: 958 bytes --]

From 2bd92abdf273e2bc3a899afffe0245b232150992 Mon Sep 17 00:00:00 2001
From: Christian Franke <christian.franke@t-online.de>
Date: Thu, 2 Sep 2021 18:52:39 +0200
Subject: [PATCH] Add -Werror=return-type to CXXFLAGS/OBJCXXFLAGS.

G++ >= 8.0 assumes that control never reaches the end of a
non-void function (GCC Bugzilla 96181).
---
 lib/compilers.cygpart | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/compilers.cygpart b/lib/compilers.cygpart
index b775489..129e115 100644
--- a/lib/compilers.cygpart
+++ b/lib/compilers.cygpart
@@ -56,9 +56,9 @@ declare -x CXX="g++";
 #  Flags passed to CXX when compiling C++ code.  Individual packages may append
 #  or override this value if they will not build correctly without it.
 #  DEFAULT VALUE
-#  CFLAGS
+#  CFLAGS -Werror=return-type
 #****
-declare -x CXXFLAGS=${CFLAGS};
+declare -x CXXFLAGS="${CFLAGS} -Werror=return-type";
 
 #****d* Compiling/F77
 #  DESCRIPTION
-- 
2.33.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-02 17:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02 17:01 [PATCH cygport] Add -Werror=return-type to CXXFLAGS/OBJCXXFLAGS Christian Franke

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).