[PATCH] D24584: Do not warn about format strings that are indexed string literals.

Meike Baumgärtner via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 14 14:25:21 PDT 2016


meikeb created this revision.
meikeb added a reviewer: rsmith.
meikeb added subscribers: cfe-commits, srhines.

The warning for a format string not being a sting literal and therefore
being potentially insecure is overly strict for indecies into sting
literals. This fix checks if the index into the string literal is
precomputable. If thats the case it will check if the suffix of that
sting literal is a valid format string string literal. It will still
issue the aforementioned warning for out of range indecies into the
string literal.

Patch by Meike Baumgärtner (meikeb)

https://reviews.llvm.org/D24584

Files:
  lib/Sema/SemaChecking.cpp
  test/Sema/format-strings.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24584.71435.patch
Type: text/x-patch
Size: 13947 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160914/7cd530ef/attachment-0001.bin>


More information about the cfe-commits mailing list