<div dir="ltr">Hi, <div>I have a question regarding the right way to get CanQualType/QualType for "ssize_t".</div><div><br></div><div>The class <a class="gmail-code" href="https://clang.llvm.org/doxygen/classclang_1_1ASTContext.html#a7c89acd533ffea38c5011885d8d029e4" style="font-size:13px;color:rgb(70,101,162);text-decoration-line:none;font-family:monospace,fixed;white-space:pre-wrap;background-color:rgb(251,252,253)">ASTContext</a> (<a href="https://clang.llvm.org/doxygen/ASTContext_8cpp_source.html#l04524">https://clang.llvm.org/doxygen/ASTContext_8cpp_source.html#l04524</a>) </div><div>has a number of methods: getIntMaxType, getUintMaxType, getSizeType etc but if i am not mistaken it doesn't have the counterpart for "ssize_t". </div><div>After looking at the implementation of those methods i see that it's missing in the class <a class="gmail-code" href="https://clang.llvm.org/doxygen/classclang_1_1TargetInfo.html" style="font-size:13px;color:rgb(70,101,162);text-decoration-line:none;font-family:monospace,fixed;white-space:pre-wrap;background-color:rgb(251,252,253)">TargetInfo</a> either. <a href="https://clang.llvm.org/doxygen/include_2clang_2Basic_2TargetInfo_8h_source.html#l00228">https://clang.llvm.org/doxygen/include_2clang_2Basic_2TargetInfo_8h_source.html#l00228</a> .</div><div><br></div><div>Some context:</div><div><br></div><div>in PrintfSpecifier::getArgType (in ./lib/Analysis/PrintfFormatString.cpp)</div><div>there is a FIXME:</div><div><br></div><div>     case LengthModifier::AsSizeT:</div><div>         return ArgType(); // FIXME: ssize_t</div><div><br></div><div>as a result Clang doesn't analyze the format string "%zd" correctly</div><div>and doesn't warn on the following (broken) code:</div><div><br></div><div>    int main() {</div><div>      printf("%zd", 12.2);</div><div>      return 0;</div><div>    }</div><div><br></div><div>Kind regards, </div><div>Alexander Shaposhnikov</div></div>