Compiling with new versions of gcc

Issue #55 closed
Michael Davis created an issue

There are small warnings in new versions of gcc which are getting changed into errors. I can't seem to get pull requests on mercurial / bitbucket to do what I want so here it is in patch form.

diff -Naur fuse-zip/lib/fileNode.cpp fuse-zipb/lib/fileNode.cpp
--- fuse-zip/lib/fileNode.cpp   2019-03-12 15:25:05.906337484 -0500
+++ fuse-zipb/lib/fileNode.cpp  2019-03-12 15:19:50.944188680 -0500
@@ -244,10 +244,10 @@
             buffer = new BigBuffer(zip, id(), static_cast<size_t>(m_size));
             state = OPENED;
         }
-        catch (std::bad_alloc) {
+        catch (std::bad_alloc&) {
             return -ENOMEM;
         }
-        catch (std::exception) {
+        catch (std::exception&) {
             return -EIO;
         }
     }
diff -Naur fuse-zip/lib/fuse-zip.cpp fuse-zipb/lib/fuse-zip.cpp
--- fuse-zip/lib/fuse-zip.cpp   2019-03-12 15:25:05.907337487 -0500
+++ fuse-zipb/lib/fuse-zip.cpp  2019-03-12 15:20:24.914312560 -0500
@@ -89,7 +89,7 @@
             throw;
         }
     }
-    catch (std::bad_alloc) {
+    catch (std::bad_alloc&) {
         syslog(LOG_ERR, "no enough memory");
         fprintf(stderr, "%s: no enough memory\n", program);
         return NULL;
@@ -218,10 +218,10 @@
     try {
         return node->open();
     }
-    catch (std::bad_alloc) {
+    catch (std::bad_alloc&) {
         return -ENOMEM;
     }
-    catch (std::exception) {
+    catch (std::exception&) {
         return -EIO;
     }
 }

Comments (2)

  1. Log in to comment