Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F2115834
0001-global-fix-compile-error-at-pragma-GCC-diagnostic.patch
jukivili (Jussi Kivilinna)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
jukivili
Jan 26 2021, 6:48 PM
2021-01-26 18:48:14 (UTC+1)
Size
2 KB
Subscribers
None
0001-global-fix-compile-error-at-pragma-GCC-diagnostic.patch
View Options
From 1adf5ae5b6c287ac2ec799f45251c6429da3f865 Mon Sep 17 00:00:00 2001
From: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Date: Tue, 26 Jan 2021 19:38:48 +0200
Subject: [PATCH] global: fix compile error at pragma GCC diagnostic
* src/global.c (_gcry_vcontrol): Move "pragma GCC diagnostics" outside
function.
--
Building with GCC-4.2 (Ubuntu 8.04) failed with error:
global.c: In function '_gcry_vcontrol':
global.c:714: error: #pragma GCC diagnostic not allowed inside functions
global.c:715: error: #pragma GCC diagnostic not allowed inside functions
global.c:742: error: #pragma GCC diagnostic not allowed inside functions
GnuPG-bug-id: 5264
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
---
src/global.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/global.c b/src/global.c
index be65df54..b51cb763 100644
--- a/src/global.c
+++ b/src/global.c
@@ -454,6 +454,11 @@ _gcry_get_config (int mode, const char *what)
+#if _GCRY_GCC_VERSION >= 40200
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wswitch"
+#endif
+
/* Command dispatcher function, acting as general control
function. */
gcry_err_code_t
@@ -710,10 +715,6 @@ _gcry_vcontrol (enum gcry_ctl_cmds cmd, va_list arg_ptr)
rc = _gcry_fips_run_selftests (1);
break;
-#if _GCRY_GCC_VERSION >= 40200
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wswitch"
-#endif
case PRIV_CTL_INIT_EXTRNG_TEST: /* Init external random test. */
rc = GPG_ERR_NOT_SUPPORTED;
break;
@@ -738,9 +739,6 @@ _gcry_vcontrol (enum gcry_ctl_cmds cmd, va_list arg_ptr)
case PRIV_CTL_DUMP_SECMEM_STATS:
_gcry_secmem_dump_stats (1);
break;
-#if _GCRY_GCC_VERSION >= 40200
-# pragma GCC diagnostic pop
-#endif
case GCRYCTL_DISABLE_HWF:
{
@@ -823,6 +821,9 @@ _gcry_vcontrol (enum gcry_ctl_cmds cmd, va_list arg_ptr)
return rc;
}
+#if _GCRY_GCC_VERSION >= 40200
+# pragma GCC diagnostic pop
+#endif
/* Set custom allocation handlers. This is in general not useful
--
2.27.0
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1354005
Attached To
T5264: libgcrypt 1.9.0 does not compile on old Mac OS X, versions 10.5.8 (Leopard) and 10.4.11 (Tiger), both on PPC hardware
Event Timeline
Log In to Comment