[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master e41c2a5: Forestall gcc-4.9.2 external attribu
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master e41c2a5: Forestall gcc-4.9.2 external attribute warnings, improved |
Date: |
Sat, 11 Mar 2017 10:31:55 -0500 (EST) |
branch: master
commit e41c2a5f8a7a17130afac6944299e9bfc05b0537
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Forestall gcc-4.9.2 external attribute warnings, improved
Reverted the 20151221T0138Z change for 'wx_new_test.cpp' only, and
reworked that change in a better way. The unit test explicitly
shared-library attribute, inducing a warning that was suppressed with
a #pragma. Now, it is simply not endowed with any such attribute, so
that no warning arises or requires suppression.
---
wx_new.hpp | 5 ++++-
wx_new_test.cpp | 16 +++-------------
2 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/wx_new.hpp b/wx_new.hpp
index c0ee3af..b26492f 100644
--- a/wx_new.hpp
+++ b/wx_new.hpp
@@ -29,7 +29,10 @@
// TODO ?? CALCULATION_SUMMARY Revise in light of this message:
// http://lists.nongnu.org/archive/html/lmi/2006-10/msg00024.html
-#if defined HAVE_CONFIG_H
+#if defined UNIT_TESTING_WX_NEW
+// Don't use so attributes for unit test.
+# define LMI_WX_NEW_SO
+#elif defined HAVE_CONFIG_H
// For msw, rely on the 'auto-import' kludge favored by autotools.
# define LMI_WX_NEW_SO
#elif defined LMI_MSW
diff --git a/wx_new_test.cpp b/wx_new_test.cpp
index d2921b1..7f302eb 100644
--- a/wx_new_test.cpp
+++ b/wx_new_test.cpp
@@ -25,22 +25,12 @@
#include "pchfile.hpp"
+#define UNIT_TESTING_WX_NEW
// The '.cpp' file is deliberately included here instead of the header
// because it was probably already compiled for inclusion in a dll,
-// resulting in an object that wouldn't necessarily work here.
-//
-// Explicitly include "wx_new.hpp" first for LMI_GCC_VERSION from
-// "config.hpp".
-
-#include "wx_new.hpp"
-#if defined __GNUC__ && 40600 <= LMI_GCC_VERSION
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wattributes"
-#endif // defined __GNUC__ && 40600 <= LMI_GCC_VERSION
+// resulting in an object that wouldn't necessarily work here because
+// of unwanted shared-library attributes.
#include "wx_new.cpp"
-#if defined __GNUC__ && 40600 <= LMI_GCC_VERSION
-# pragma GCC diagnostic pop
-#endif // defined __GNUC__ && 40600 <= LMI_GCC_VERSION
#include "test_tools.hpp"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [lmi] master e41c2a5: Forestall gcc-4.9.2 external attribute warnings, improved,
Greg Chicares <=