Skip to content

Instantly share code, notes, and snippets.

@davidrios
Created August 23, 2019 13:47
Show Gist options
  • Save davidrios/a6a3540e320e418d6425f1d309d04742 to your computer and use it in GitHub Desktop.
Save davidrios/a6a3540e320e418d6425f1d309d04742 to your computer and use it in GitHub Desktop.
--- igraph-0.7.1/src/f2c/arithchk.c
+++ igraph-0.7.1-patched/src/f2c/arithchk.c
@@ -110,8 +110,19 @@
return 0;
}
-char *emptyfmt = ""; /* avoid possible warning message with printf("") */
+/* avoid possible warning message with printf("") */
+const char *const emptyfmt = "";
+#ifdef __GNUC__
+# pragma GCC diagnostic push
+# ifndef __clang__
+# pragma GCC diagnostic ignored "-Wformat-security"
+# pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+# else
+# pragma GCC diagnostic ignored "-Wformat-zero-length"
+# endif
+#endif
+
static Akind *
ccheck(void)
{
@@ -165,6 +176,12 @@
t = sqrt(t_nan);
return errno == 0;
}
+
+#ifdef __GNUC__
+# ifndef __clang__
+# pragma GCC diagnostic pop
+# endif
+#endif
void
get_nanbits(unsigned int *b, int k)
--- igraph-0.7.1/src/f2c/sysdep1.h
+++ igraph-0.7.1-patched/src/f2c/sysdep1.h
@@ -15,8 +15,13 @@
#ifdef __linux__
#define USE_LARGEFILE
+
+#ifdef __GLIBC__
#define OFF_T __off64_t
-#endif
+#else
+#define OFF_T off64_t
+#endif /* __GLIBC__ */
+#endif /* __linux__ */
#ifdef _AIX43
#define _LARGE_FILES
--- igraph-0.7.1/src/f2c/uninit.c
+++ igraph-0.7.1-patched/src/f2c/uninit.c
@@ -250,9 +250,11 @@
*/
-#if (defined(__GLIBC__)&& ( __GLIBC__>=2) && (__GLIBC_MINOR__>=2) )
-#define _GNU_SOURCE 1
+#ifdef __GLIBC__
#define IEEE0_done
+
+#if ((__GLIBC__>=2) && (__GLIBC_MINOR__>=2))
+#define _GNU_SOURCE 1
#include <fenv.h>
static void
ieee0(Void)
@@ -265,14 +267,11 @@
unsupported_error();
}
-#endif /* Glibc control */
-
/* Many linux cases will be treated through GLIBC. Note that modern
* linux runs on many non-i86 plaforms and as a result the following code
* must be processor dependent rather than simply OS specific */
-#if (defined(__linux__)&&(!defined(IEEE0_done)))
-#define IEEE0_done
+#else /* __GLIBC__<2.2 */
#include <fpu_control.h>
@@ -401,7 +400,8 @@
#endif /* _FPU_IEEE */
}
-#endif /* __linux__ */
+#endif /* __GLIBC__>2.2 */
+#endif /* __GLIBC__ */
/* Specific to OSF/1 */
#if (defined(__alpha)&&defined(__osf__))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment