summaryrefslogtreecommitdiff
path: root/sys-libs/libvpd/files/2.2.8-gcc11.patch
blob: 7e09f8329bba4120457886f91bf138f254c94062 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
From 83ccb994e30364c0703d7b8c15817d56b42da2e6 Mon Sep 17 00:00:00 2001
From: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Date: Wed, 7 Apr 2021 14:11:41 +0530
Subject: [PATCH] Remove dynamic exception specification
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Tomasz Kłoczko reported that the build fails, while compiling
with GCC 11:

In file included from src/vpdretriever.cpp:25:
./src/libvpd-2/vpdretriever.hpp:62:33: error: ISO C++17 does not allow dynamic exception specifications
   62 |                                 throw( VpdException& );
      |                                 ^~~~~
./src/libvpd-2/vpdretriever.hpp:74:33: error: ISO C++17 does not allow dynamic exception specifications
   74 |                                 throw( VpdException& );
      |                                 ^~~~~
src/vpdretriever.cpp:50:37: error: ISO C++17 does not allow dynamic exception specifications
   50 |                 string dbFileName ) throw( VpdException& )
      |                                     ^~~~~
src/vpdretriever.cpp:62:39: error: ISO C++17 does not allow dynamic exception specifications
   62 |         VpdRetriever::VpdRetriever( ) throw( VpdException& )
      |                                       ^~~~~
make: *** [Makefile:660: src/vpdretriever.lo] Error 1

As part of
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html,
the dynamic exception specification have been removed. Remove the
throw specifier, to specify that the function might throw an exception.

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 src/libvpd-2/vpdretriever.hpp | 6 ++----
 src/vpdretriever.cpp          | 4 ++--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/libvpd-2/vpdretriever.hpp b/src/libvpd-2/vpdretriever.hpp
index 0d91ac4..1be2664 100644
--- a/src/libvpd-2/vpdretriever.hpp
+++ b/src/libvpd-2/vpdretriever.hpp
@@ -58,8 +58,7 @@ namespace lsvpd
 			 * @param dbFileName
 			 *   The file name for the VPD database.
 			 */
-			VpdRetriever( string envDir, string dbFileName )
-				throw( VpdException& );
+			VpdRetriever( string envDir, string dbFileName );
 			
 			/**
 			 * Builds A VpdRetriever object that can be used for reading the
@@ -70,8 +69,7 @@ namespace lsvpd
 			 * this constructor, there were serious underlying issues that
 			 * are not recoverable.  Uses the default dir and filename
 			 */
-			VpdRetriever( )
-				throw( VpdException& );
+			VpdRetriever( );
 			~VpdRetriever( );
 
 			/**
diff --git a/src/vpdretriever.cpp b/src/vpdretriever.cpp
index 9f7e7a0..470047e 100644
--- a/src/vpdretriever.cpp
+++ b/src/vpdretriever.cpp
@@ -47,7 +47,7 @@ namespace lsvpd
 	const string VpdRetriever::UDEV_NOTIFY_FILE ( "/run/run.vpdupdate" );
 
 	VpdRetriever::VpdRetriever( string envDir,
-		string dbFileName ) throw( VpdException& )
+		string dbFileName )
 	{
 		try {
 			db = new VpdDbEnv( envDir, dbFileName, true );
@@ -59,7 +59,7 @@ namespace lsvpd
 		}
 	}
 	
-	VpdRetriever::VpdRetriever( ) throw( VpdException& )
+	VpdRetriever::VpdRetriever( )
 	{
 		struct stat vpd_stat,udev_stat;
 		const string vpddb = VpdRetriever::DEFAULT_DIR + VpdRetriever::DEFAULT_FILE;