aports/main/gcc/0006-Enable-Wformat-and-Wformat-security-by-default.patch
Ariadne Conill 5cc8742a56 main/gcc: add loongarch to --as-needed patch
This was missed in initial loongarch bringup, apparently.

Closes: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/88144
2025-08-04 12:19:03 -07:00

35 lines
1.4 KiB
Diff

From 58a94690d4dd7b34543d9d154abc96d2d90d3b32 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:47:43 +0000
Subject: [PATCH] Enable -Wformat and -Wformat-security by default.
---
gcc/c-family/c.opt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 75b6531860e..78830ce4b42 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -805,7 +805,7 @@ Warn about function calls with format strings that write past the end
of the destination region.
Wformat-security
-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
+C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
Warn about possible security problems with format functions.
Wformat-signedness
@@ -830,7 +830,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
Warn about zero-length formats.
Wformat=
-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
+C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
Warn about printf/scanf/strftime/strfmon format string anomalies.
Wframe-address
--
2.50.1