{"comment":{"url":"https://api.github.com/repos/siemens/cppcheck/comments/15017016","html_url":"https://github.com/siemens/cppcheck/commit/43d2f585f3b7a621171796bef1f88ef4a65d9c08#commitcomment-15017016","id":15017016,"user":{"login":"3adev","id":9527421,"avatar_url":"https://avatars.githubusercontent.com/u/9527421?v=3","gravatar_id":"","url":"https://api.github.com/users/3adev","html_url":"https://github.com/3adev","followers_url":"https://api.github.com/users/3adev/followers","following_url":"https://api.github.com/users/3adev/following{/other_user}","gists_url":"https://api.github.com/users/3adev/gists{/gist_id}","starred_url":"https://api.github.com/users/3adev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3adev/subscriptions","organizations_url":"https://api.github.com/users/3adev/orgs","repos_url":"https://api.github.com/users/3adev/repos","events_url":"https://api.github.com/users/3adev/events{/privacy}","received_events_url":"https://api.github.com/users/3adev/received_events","type":"User","site_admin":false},"position":37,"line":3764,"path":"test/testpreprocessor.cpp","commit_id":"43d2f585f3b7a621171796bef1f88ef4a65d9c08","created_at":"2015-12-16T15:17:39Z","updated_at":"2015-12-16T15:17:39Z","body":"Comments in directives we cannot avoid; we might even actually want them, for instance if trying to check against a coding style guide that requests mentioning the  #if condition in a comment to the #endif directive.\r\n\r\nRegarding UTF-8, it is the default encoding for XML if no encoding is specified in the prolog and no BOM is present at the start of the file, so UTF-8 characters should be fine. We 'only' need to worry about (ASCII) characters which could disrupt XML parsing.\r\n\r\nIt remains right however that the RE here will not match if comments are present in the directive, and that it would need to do some preprocessing on the directive. I might argue that in the specific case of Y2038, _TIME_BITS and _USE_TIME_BITS64, comments in the defines would not match the GLIBC coding style; but for the sake of genericity, I can add a method to the Python Directive class to produce a the directive string with any comments removed.\r\n\r\nBTW: the coding style for GLIBC involves indenting directives by placing spaces between the initial \"#\" and the keyword. IIUC, that is not something cppcheck currently supports, right?"}}