* Macros for controlling warnings in GCC >= 4.2 and clang >= 2.8
*/
#if defined(__clang__) && ((__clang_major__ * 100) + __clang_minor__ >= 208)
+# define DIAG_UNKNOWN_PRAGMAS unknown-pragmas
# define DIAG_PRAGMA(_x) PRAGMA(clang diagnostic _x)
# define DIAG_OFF(_x) DIAG_PRAGMA(ignored JOINSTR(-W,_x))
# define DIAG_ON(_x) DIAG_PRAGMA(warning JOINSTR(-W,_x))
-# define DIAG_OFF_OPTIONAL(_x) \
- DIAG_OFF(ignored unknown-pragmas) \
- DIAG_OFF(_x) \
- DIAG_ON(warning unknown-pragmas)
-# define DIAG_ON_OPTIONAL(_x) \
- DIAG_OFF(unknown-pragmas) \
- DIAG_ON(_x) \
- DIAG_ON(unknown-pragmas)
# define DIAG_PUSH() DIAG_PRAGMA(push)
# define DIAG_POP() DIAG_PRAGMA(pop)
#elif !defined(__clang__) && defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402
+# define DIAG_UNKNOWN_PRAGMAS pragmas
# define DIAG_PRAGMA(_x) PRAGMA(GCC diagnostic _x)
# define DIAG_OFF(_x) DIAG_PRAGMA(ignored JOINSTR(-W,_x))
# define DIAG_ON(_x) DIAG_PRAGMA(warning JOINSTR(-W,_x))
-# define DIAG_OFF_OPTIONAL(_x) \
- DIAG_OFF(pragmas) \
- DIAG_OFF(_x) \
- DIAG_ON(pragmas)
-# define DIAG_ON_OPTIONAL(_x) \
- DIAG_OFF(pragmas) \
- DIAG_ON(_x) \
- DIAG_ON(pragmas)
# define DIAG_PUSH() DIAG_PRAGMA(push)
# define DIAG_POP() DIAG_PRAGMA(pop)
#else
# define DIAG_OFF(_x)
# define DIAG_ON(_x)
-# define DIAG_OFF_OPTIONAL(_x)
-# define DIAG_ON_OPTIONAL(_x)
# define DIAG_PUSH()
# define DIAG_POP()
#endif
#include <freeradius-devel/util/event.h>
#include <freeradius-devel/server/module.h>
-DIAG_OFF_OPTIONAL(disabled-macro-expansion)
+DIAG_OFF(DIAG_UNKNOWN_PRAGMAS)
+DIAG_OFF(disabled-macro-expansion)
+DIAG_ON(DIAG_UNKNOWN_PRAGMAS)
#define FR_CURL_SET_OPTION(_x, _y)\
do {\
int _ret;\
*
* #define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)
*/
-DIAG_OFF_OPTIONAL(disabled-macro-expansion)
+DIAG_OFF(DIAG_UNKNOWN_PRAGMAS)
+DIAG_OFF(disabled-macro-expansion)
+DIAG_ON(DIAG_UNKNOWN_PRAGMAS)
#define SET_MOPTION(_mandle, _opt, _val)\
do {\
if ((ret = curl_multi_setopt(mandle, _opt, _val)) != CURLM_OK) {\
#ifdef HAVE_JSON
# if defined(HAVE_JSONMC_JSON_H)
-DIAG_OFF_OPTIONAL(documentation-deprecated-sync)
+DIAG_OFF(DIAG_UNKNOWN_PRAGMAS)
+DIAG_OFF(documentation-deprecated-sync)
# include <json-c/json.h>
-DIAG_ON_OPTIONAL(documentation-deprecated-sync)
+DIAG_ON(documentation-deprecated-sync)
+DIAG_ON(DIAG_UNKNOWN_PRAGMAS)
# elif defined(HAVE_JSON_JSON_H)
# include <json/json.h>
#ifdef HAVE_JSON
# if defined(HAVE_JSONMC_JSON_H)
-DIAG_OFF_OPTIONAL(documentation-deprecated-sync)
+DIAG_OFF(DIAG_UNKNOWN_PRAGMAS)
+DIAG_OFF(documentation-deprecated-sync)
# include <json-c/json.h>
-DIAG_ON_OPTIONAL(documentation-deprecated-sync)
+DIAG_ON(documentation-deprecated-sync)
+DIAG_ON(DIAG_UNKNOWN_PRAGMAS)
# elif defined(HAVE_JSON_JSON_H)
# include <json/json.h>
* Turn off documentation warnings as file/line
* args aren't used for non-debug builds.
*/
-DIAG_OFF_OPTIONAL(documentation)
+DIAG_OFF(DIAG_UNKNOWN_PRAGMAS)
+DIAG_OFF(documentation)
+DIAG_ON(DIAG_UNKNOWN_PRAGMAS)
#endif
#define FR_EV_BATCH_FDS (256)
mruby_set_vps(request, mrb, mruby_request, "@control", &request->control_pairs);
mruby_set_vps(request, mrb, mruby_request, "@session_state", &request->session_state_pairs);
-DIAG_OFF_OPTIONAL(class-varargs)
+DIAG_OFF(DIAG_UNKNOWN_PRAGMAS)
+DIAG_OFF(class-varargs)
mruby_result = mrb_funcall(mrb, mrb_obj_value(inst->mruby_module), function_name, 1, mruby_request);
-DIAG_ON_OPTIONAL(class-varargs)
+DIAG_ON(class-varargs)
+DIAG_ON(DIAG_UNKNOWN_PRAGMAS)
/* Two options for the return value:
* - a fixnum: convert to rlm_rcode_t, and return that
* @copyright 2016 The FreeRADIUS server project
*/
-DIAG_OFF_OPTIONAL(documentation)
+DIAG_OFF(DIAG_UNKNOWN_PRAGMAS)
+DIAG_OFF(documentation)
#include <mruby.h>
#include <mruby/compile.h>
#include <mruby/array.h>
#include <mruby/numeric.h>
#include <mruby/string.h>
#include <mruby/variable.h>
-DIAG_ON_OPTIONAL(documentation)
+DIAG_ON(documentation)
+DIAG_ON(DIAG_UNKNOWN_PRAGMAS)
struct RClass *mruby_request_class(mrb_state *mrb, struct RClass *parent);
talloc_free(handles);
}
-DIAG_OFF_OPTIONAL(shadow)
+DIAG_OFF(DIAG_UNKNOWN_PRAGMAS)
+DIAG_OFF(shadow)
static void rlm_perl_destruct(PerlInterpreter *perl)
{
dTHXa(perl);
perl_destruct(perl);
perl_free(perl);
}
-DIAG_ON_OPTIONAL(shadow)
+DIAG_ON(shadow)
+DIAG_ON(DIAG_UNKNOWN_PRAGMAS)
static void rlm_destroy_perl(PerlInterpreter *perl)
{
extern "C" {
#endif
-DIAG_OFF_OPTIONAL(documentation)
+DIAG_OFF(DIAG_UNKNOWN_PRAGMAS)
+DIAG_OFF(documentation)
#include <unbound.h>
#include <unbound-event.h>
-DIAG_ON_OPTIONAL(documentation)
+DIAG_ON(documentation)
+DIAG_ON(DIAG_UNKNOWN_PRAGMAS)
/** Wrapper around our event loop specifying callbacks for creating new event handles
*
#include <freeradius-devel/server/request.h>
-DIAG_OFF_OPTIONAL(documentation)
+DIAG_OFF(DIAG_UNKNOWN_PRAGMAS)
+DIAG_OFF(documentation)
#include <unbound.h>
-DIAG_ON_OPTIONAL(documentation)
+DIAG_ON(documentation)
+DIAG_ON(DIAG_UNKNOWN_PRAGMAS)
/** Logging state
*