[all-commits] [llvm/llvm-project] 72f6ab: [clang][Sema] Fix format size estimator's handling...

Takuya Shimizu via All-commits all-commits at lists.llvm.org
Mon Sep 11 20:23:09 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 72f6abb9bca68bf1398b321a73ebe3158bca67e5
  Author: Takuya Shimizu <shimizu2486 at gmail.com>
  Date:   2023-09-12 (Tue, 12 Sep 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaChecking.cpp
    M clang/test/Sema/warn-fortify-source.c

  Log Message:
  [clang][Sema] Fix format size estimator's handling of %o, %x, %X with alternative form

The wrong handling of %x specifier with alternative form causes a false positive in linux kernel (https://github.com/ClangBuiltLinux/linux/issues/1923#issuecomment-1696075886)

The kernel code: https://github.com/torvalds/linux/blob/651a00bc56403161351090a9d7ddbd7095975324/drivers/media/pci/cx18/cx18-mailbox.c#L99

This patch fixes this handling, and also adds some standard wordings as comments to clarify the reason.

Reviewed By: nickdesaulniers
Differential Revision: https://reviews.llvm.org/D159138

More information about the All-commits mailing list