13b4184b2e434953f411f20dd87104f99b550275 hiram Fri Oct 2 11:53:27 2015 -0700 fixup gcc warnings for -Wunused-but-set-variable refs #16121 diff --git src/hg/lib/hgFindSpecCustom.c src/hg/lib/hgFindSpecCustom.c index 6c65a1f..4edceb7 100644 --- src/hg/lib/hgFindSpecCustom.c +++ src/hg/lib/hgFindSpecCustom.c @@ -37,33 +37,33 @@ freeMem(hfs->termRegex); hfs->termRegex = cloneString(buf); } else if (hfs->termRegex == NULL) hfs->termRegex = ""; } static void checkTermRegex(struct hgFindSpec *hfs) /* Make sure termRegex compiles OK. */ { if (isNotEmpty(hfs->termRegex)) { char buf[256]; safef(buf, sizeof(buf), "hfsPolish: search %s: termRegex", hfs->searchName); - const regex_t *compiledExp = regexCompile(hfs->termRegex, buf, + // Discard returned compiled expression + (void) regexCompile(hfs->termRegex, buf, (REG_EXTENDED | REG_ICASE | REG_NOSUB)); - compiledExp = NULL; // Avoid compiler warning about unused variable / return value } } static void escapeTermRegex(struct hgFindSpec *hfs) /* Escape any '\' characters in termRegex for sql storage. */ { if (isNotEmpty(hfs->termRegex)) { char *orig = hfs->termRegex; hfs->termRegex = makeEscapedString(orig, '\\'); freeMem(orig); } }