Really StringAttr should be using size_t for the length on get and set. It is causing coverity to report some warnings about possible pointer overflow on expressions of the form
See CID 1143189 for one example.
From a quick scan there are a large number of calls to StringAttr::length() which should really be (more effiient) calls to StringAttr::isEmpty(). They should be changed at the same time.