diff --git a/src/html/htmltag.cpp b/src/html/htmltag.cpp
index c14b39fe2d..6def30c189 100644
--- a/src/html/htmltag.cpp
+++ b/src/html/htmltag.cpp
@@ -150,6 +150,7 @@ wxHtmlTagsCache::wxHtmlTagsCache(const wxString& source)
if (match_pos == tag_len) {
pos = pos - tag_len - 3;
stpos = pos;
+ wxUnusedVar(stpos);
break;
}
else {