llvm-project
39315663 - [-Wunsafe-buffer-usage] Fix false warnings when const sized array is safely accessed (array [idx %const]) (#140113)

Commit
175 days ago
[-Wunsafe-buffer-usage] Fix false warnings when const sized array is safely accessed (array [idx %const]) (#140113) The -Wunsafe-buffer-usage analysis currently warns when a const sized array is safely accessed, with an index that is bound by the remainder operator. The false alarm is now suppressed. Example: int circular_buffer(int array[10], uint idx) { return array[idx %10]; // Safe operation } rdar://148443453 --------- Co-authored-by: MalavikaSamak <malavika2@apple.com>
Author
Parents
Loading