Skip to content

Commit

Permalink
Guard GCC pragmas
Browse files Browse the repository at this point in the history
To avoid warnings when using other compilers s.t. clang or msvc
  • Loading branch information
amtriathlon committed Jul 17, 2022
1 parent 9e99199 commit 387873d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contrib/boost/GeometricTools_BSplineCurve.h
Expand Up @@ -3,8 +3,10 @@
// it requires.

// disable warning messages
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wunused-value"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif

#define LogError(a) (0); return 0;
#define LogAssert(a,b) (0)
Expand Down
2 changes: 2 additions & 0 deletions contrib/levmar/misc_core.c
Expand Up @@ -22,8 +22,10 @@
#endif


#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#pragma GCC diagnostic ignored "-Wcpp"
#endif

/* precision-specific definitions */
#define LEVMAR_CHKJAC LM_ADD_PREFIX(levmar_chkjac)
Expand Down
2 changes: 2 additions & 0 deletions src/Python/SIP/Bindings.h
Expand Up @@ -9,7 +9,9 @@
#undef slots
#include <Python.h>

#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wcast-function-type" // shut gcc up
#endif

class PythonDataSeries {

Expand Down
2 changes: 2 additions & 0 deletions src/R/RLibrary.h
Expand Up @@ -19,7 +19,9 @@
#ifndef GC_R_Library_H
#define GC_R_Library_H

#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wparentheses"
#endif

// QFunctionPointer typedef introduced in QT5
#include <QtGlobal>
Expand Down
2 changes: 2 additions & 0 deletions src/R/RTool.cpp
Expand Up @@ -39,7 +39,9 @@
#include "GenericChart.h"
#include "Perspective.h"

#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wcast-function-type" // shut gcc up
#endif

// Structure used to register routines has changed in v3.4 of R
//
Expand Down
2 changes: 2 additions & 0 deletions src/Train/KurtSmartControl.cpp
Expand Up @@ -217,7 +217,9 @@ smart_control_config_data smart_control_process_config_data(const uint8_t *data,


#ifndef MIN
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wtype-limits"
#endif
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
#endif
Expand Down

0 comments on commit 387873d

Please sign in to comment.