Hide unused variable warnings in git error strings

These strings aren't actually used right now, but they may be used
in the future, so don't actually remove them but silence the error that
they aren't used.
This commit is contained in:
Ian McInerney
2023-12-24 01:22:21 +00:00
parent 687389224e
commit 3a90b729ea
3 changed files with 25 additions and 1 deletions
+14 -1
View File
@@ -21,6 +21,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
// None of these values are currently used, but Seth says they may be used in the future,
// so for now, just surpress the warning that is generated by the fact they exist and aren't
// used anywhere.
#ifdef HAVE_WUNUSED_CONST_VARIABLE
_Pragma( "GCC diagnostic push" ) \
_Pragma( "GCC diagnostic ignored \"-Wunused-const-variable\"" )
#endif
namespace KIGIT_ERROR
{
#undef _
@@ -63,4 +72,8 @@ namespace KIGIT_ERROR
const char* const kUnknownError = _("Unknown error.");
const char* const kNoError = _("No error.");
}
}
#ifdef HAVE_WUNUSED_CONST_VARIABLE
_Pragma( "GCC diagnostic pop" )
#endif