From ff1ceeddaca2015f2c7bbf48146d29aaeefe247f Mon Sep 17 00:00:00 2001 From: Horst Schirmeier Date: Fri, 23 Aug 2013 10:32:38 +0200 Subject: [PATCH] util: silence const warnings with optionparser We don't use the warned-about part of optionparser's interface anyways. Change-Id: I42c4714e4dce4112ea5b6cfb5159ed8b62d4c418 --- src/core/util/CommandLine.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/core/util/CommandLine.hpp b/src/core/util/CommandLine.hpp index de14526e..f26e73cf 100644 --- a/src/core/util/CommandLine.hpp +++ b/src/core/util/CommandLine.hpp @@ -4,10 +4,17 @@ #include #include #include + +// Ignore warnings regarding const removal, we don't use this part of +// optionparser's interface anyways. (Works with GCC 4.6 and above, throws a +// warning with earlier versions. The reset to "warning" is necessary for +// those earlier versions.) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" #include "optionparser/optionparser.h" #include "optionparser/optionparser_ext.hpp" - - +#pragma GCC diagnostic warning "-Wcast-qual" +#pragma GCC diagnostic pop namespace fail { /**