bug-ncurses
[Top][All Lists]
Advanced

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

Compile error in lib_mouse.c (gcc pragma)


From: vcoxvco
Subject: Compile error in lib_mouse.c (gcc pragma)
Date: Mon, 13 Nov 2017 23:00:18 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

Hi,

in lib_mouse.c, I get an error when compiling with older gcc:
    gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973]

Error is:
gcc -DHAVE_CONFIG_H -I../ncurses -I. -I../include -D_GNU_SOURCE -DNDEBUG -m64 --param max-inline-insns-single=1200 -c ../ncurses/./base/lib_mouse.c -o ../objects/lib_mouse.o
../ncurses/./base/lib_mouse.c: In function 'load_gpm_library':
../ncurses/./base/lib_mouse.c:489: error: #pragma GCC diagnostic not allowed 
inside functions
../ncurses/./base/lib_mouse.c:497: error: #pragma GCC diagnostic not allowed 
inside functions
gmake[2]: *** [../objects/lib_mouse.o] Error 1


Below is a patch that works on this old version and on a recent gcc (7.2.1)
(not tested with clang, though)

Regards
Vassili




--- ../ncurses/./base/lib_mouse.c.orig  2017-11-13 12:56:20.226607226 +0000
+++ ../ncurses/./base/lib_mouse.c       2017-11-13 13:01:35.011828209 +0000
@@ -486,15 +486,17 @@
 {
     sp->_mouse_gpm_found = FALSE;
     if ((sp->_dlopen_gpm = dlopen(LIBGPM_SONAME, my_RTLD)) != 0) {
-#pragma GCC diagnostic push
 #if (defined(__GNUC__) && (__GNUC__ >= 5)) || defined(__clang__)
+#pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wpedantic"
 #endif
        if (GET_DLSYM(gpm_fd) == 0 ||
            GET_DLSYM(Gpm_Open) == 0 ||
            GET_DLSYM(Gpm_Close) == 0 ||
            GET_DLSYM(Gpm_GetEvent) == 0) {
+#if (defined(__GNUC__) && (__GNUC__ >= 5)) || defined(__clang__)
 #pragma GCC diagnostic pop
+#endif
            T(("GPM initialization failed: %s", dlerror()));
            unload_gpm_library(sp);
        } else {


--
V. Courzakis
email: address@hidden




reply via email to

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