From 8874eef8ff70de6416266d719fa74eec39e5d8f9 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 17 Jan 2019 15:04:44 -0500 Subject: [PATCH] Add pragram GCC diagnostic ignored "-Wunused-macros" --- src/gen-indic-table.py | 3 +++ src/gen-use-table.py | 3 +++ src/hb-blob.cc | 3 +++ src/hb-ot-shape-complex-indic-table.cc | 3 +++ src/hb-ot-shape-complex-use-table.cc | 3 +++ 5 files changed, 15 insertions(+) diff --git a/src/gen-indic-table.py b/src/gen-indic-table.py index e65b9814a..6532ee7e0 100755 --- a/src/gen-indic-table.py +++ b/src/gen-indic-table.py @@ -131,6 +131,8 @@ for i in range (2): what = ["INDIC_SYLLABIC_CATEGORY", "INDIC_MATRA_CATEGORY"] what_short = ["ISC", "IMC"] +print ('#pragma GCC diagnostic push') +print ('#pragma GCC diagnostic ignored "-Wunused-macros"') for i in range (2): print () vv = sorted (values[i].keys ()) @@ -148,6 +150,7 @@ for i in range (2): (what_short[i], s, what[i], v.upper (), ' '* ((48-1 - len (what[i]) - 1 - len (v)) // 8), values[i][v], v)) +print ('#pragma GCC diagnostic pop') print () print ("#define _(S,M) INDIC_COMBINE_CATEGORIES (ISC_##S, IMC_##M)") print () diff --git a/src/gen-use-table.py b/src/gen-use-table.py index 6a1a2174f..be204b60b 100755 --- a/src/gen-use-table.py +++ b/src/gen-use-table.py @@ -455,6 +455,8 @@ num = 0 offset = 0 starts = [] ends = [] +print ('#pragma GCC diagnostic push') +print ('#pragma GCC diagnostic ignored "-Wunused-macros"') for k,v in sorted(use_mapping.items()): if k in use_positions and use_positions[k]: continue print ("#define %s USE_%s /* %s */" % (k, k, v.__name__[3:])) @@ -463,6 +465,7 @@ for k,v in sorted(use_positions.items()): for suf in v.keys(): tag = k + suf print ("#define %s USE_%s" % (tag, tag)) +print ('#pragma GCC diagnostic pop') print ("") print ("static const USE_TABLE_ELEMENT_TYPE use_table[] = {") for u in uu: diff --git a/src/hb-blob.cc b/src/hb-blob.cc index c289fc635..bcf381e1a 100644 --- a/src/hb-blob.cc +++ b/src/hb-blob.cc @@ -31,7 +31,10 @@ * https://www.oracle.com/technetwork/articles/servers-storage-dev/standardheaderfiles-453865.html */ #ifndef _POSIX_C_SOURCE +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-macros" #define _POSIX_C_SOURCE 200809L +#pragma GCC diagnostic pop #endif #include "hb.hh" diff --git a/src/hb-ot-shape-complex-indic-table.cc b/src/hb-ot-shape-complex-indic-table.cc index b7e4e7c7c..43b5ef8b7 100644 --- a/src/hb-ot-shape-complex-indic-table.cc +++ b/src/hb-ot-shape-complex-indic-table.cc @@ -16,6 +16,8 @@ #include "hb-ot-shape-complex-indic.hh" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-macros" #define ISC_A INDIC_SYLLABIC_CATEGORY_AVAGRAHA /* 16 chars; Avagraha */ #define ISC_Bi INDIC_SYLLABIC_CATEGORY_BINDU /* 83 chars; Bindu */ @@ -69,6 +71,7 @@ #define IMC_TLR INDIC_MATRA_CATEGORY_TOP_AND_LEFT_AND_RIGHT /* 4 chars; Top_And_Left_And_Right */ #define IMC_TR INDIC_MATRA_CATEGORY_TOP_AND_RIGHT /* 13 chars; Top_And_Right */ #define IMC_VOL INDIC_MATRA_CATEGORY_VISUAL_ORDER_LEFT /* 19 chars; Visual_Order_Left */ +#pragma GCC diagnostic pop #define _(S,M) INDIC_COMBINE_CATEGORIES (ISC_##S, IMC_##M) diff --git a/src/hb-ot-shape-complex-use-table.cc b/src/hb-ot-shape-complex-use-table.cc index 2f3eb703e..835b95bbf 100644 --- a/src/hb-ot-shape-complex-use-table.cc +++ b/src/hb-ot-shape-complex-use-table.cc @@ -17,6 +17,8 @@ #include "hb-ot-shape-complex-use.hh" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-macros" #define B USE_B /* BASE */ #define CGJ USE_CGJ /* CGJ */ #define CS USE_CS /* CONS_WITH_STACKER */ @@ -55,6 +57,7 @@ #define VMBlw USE_VMBlw #define VMPst USE_VMPst #define VMAbv USE_VMAbv +#pragma GCC diagnostic pop static const USE_TABLE_ELEMENT_TYPE use_table[] = {