llvm/llvm-project

Create a check that warns about using %p printf specifier

Open

#43,453 建立於 2019年11月21日

在 GitHub 查看
 (11 留言) (0 反應) (0 負責人)C++ (10,782 fork)batch import
bugzillaclang:static analyzerenhancementgood first issue

倉庫指標

Star
 (26,378 star)
PR 合併指標
 (平均合併 1天 2小時) (30 天內合併 1,000 個 PR)

描述

Bugzilla Link 44108
Version unspecified
OS Windows NT

Extended Description

Recently I ran into some surprising behavior surrounding the use of %p in a printf call. On Windows %p with a nullptr prints zeros, but on Linux %p with a nullptr prints "(nil)". This is surprising, but conforming to the standard which states (roughly) that the result of %p is implementation dependent.

Create a check that warns about the potential non-portable output when using %p in a printf or scanf specifier.

貢獻者指南