]> granicus.if.org Git - clang/commit
Print NULL as "(null)" in diagnostic message
authorXing Xue <xingxue@outlook.com>
Wed, 26 Jun 2019 19:27:16 +0000 (19:27 +0000)
committerXing Xue <xingxue@outlook.com>
Wed, 26 Jun 2019 19:27:16 +0000 (19:27 +0000)
commitfb2a26cc2e40e007f19532b4e139d5f0a636d5c9
treeac09e4499a8ecee81be67e47ff6d2008b5d6223e
parentcce6f9a79e87bf331fd7e972745807f411c17cc1
Print NULL as "(null)" in diagnostic message

Summary:
Passing a null pointer to the printf family for a %s format specifier leads to undefined behaviour. The tests currently expect (null). Explicitly test for a null pointer and provide the expected string.

Authored By: andusy

Reviewers: hubert.reinterpretcast, xingxue, jasonliu, daltenty, cebowleratibm

Reviewed By: hubert.reinterpretcast

Subscribers: arphaman, jsji, cfe-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63786

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364462 91177308-0d34-0410-b5e6-96231b3b80d8
tools/c-index-test/c-index-test.c