lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Upgrading to gcc-4.9.2


From: Greg Chicares
Subject: Re: [lmi] Upgrading to gcc-4.9.2
Date: Sat, 19 Dec 2015 01:44:33 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0

On 2015-12-17 15:39, Greg Chicares wrote:
[...]
>  -Wno-attributes
> 
> /lmi/src/lmi/main_common.cpp:48:25: error: ‘unsigned int 
> _get_output_format()’ \
> redeclared without dllimport attribute: previous dllimport ignored 
> [-Werror=attributes]
>  extern "C" unsigned int _get_output_format(void) {return 1;}
> 
> I'll look into that.

I don't like resorting to a pragma, but I can find no other way
(except to turn the warning off globally, which is worse).

Why only since gcc-4.6.x? Because...
  https://gcc.gnu.org/ml/gcc-help/2011-01/msg00113.html
| > pragma GCC diagnostic <push|pop>
| > Not available until 4.6 and can be put at any point in the file.
|
| Right.

Index: main_common.cpp
===================================================================
--- main_common.cpp     (revision 6451)
+++ main_common.cpp     (working copy)
@@ -45,7 +45,14 @@
 /// For the (corrected) return type, see:
 ///   http://lists.nongnu.org/archive/html/lmi/2011-06/msg00040.html

+#   if defined __GNUC__ && 40600 <= LMI_GCC_VERSION
+#       pragma GCC diagnostic push
+#       pragma GCC diagnostic ignored "-Wattributes"
+#   endif // defined __GNUC__ && 40600 <= LMI_GCC_VERSION
 extern "C" unsigned int _get_output_format(void) {return 1;}
+#   if defined __GNUC__ && 40600 <= LMI_GCC_VERSION
+#       pragma GCC diagnostic pop
+#   endif // defined __GNUC__ && 40600 <= LMI_GCC_VERSION
 #endif // defined __MINGW32__

 /// Common application initialization.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]