[PATCH] D76951: [llvm-rc] Allow -1 for menu item IDs

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 27 15:27:07 PDT 2020


mstorsjo added a comment.

In D76951#1946998 <https://reviews.llvm.org/D76951#1946998>, @amccarth wrote:

> Negative values, especially -1, for unneeded IDs is indeed a very things in Windows resource files, not just for menu items (and submenus) but also for decorative controls on dialogs.  So this looks fine to me, though we might eventually have to relax the constraints even more.


Indeed - that file has got quite a few of such `checkNumberFits<uint16_t>()`, and to match rc.exe, one should just lose the whole check, but it's not entirely evident which ones (because some of them probably are good to keep as they are). For this particular case, we even have a testcase checking that positive values out of range are rejected though, while rc.exe silently wraps them. In any case, this patch is at least a small step in the right direction without taking on the full issue.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76951/new/

https://reviews.llvm.org/D76951





More information about the llvm-commits mailing list