r257357 - [Sema] Issue a warning for integer overflow in struct initializer

Akira Hatanaka via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 11 12:28:36 PST 2016


It triggers in dead branches and so does an initialization of an integer variable declared in a function.

I’ll look into fixing it.

> On Jan 11, 2016, at 9:54 AM, Joerg Sonnenberger via cfe-commits <cfe-commits at lists.llvm.org> wrote:
> 
> On Mon, Jan 11, 2016 at 05:22:01PM -0000, Akira Hatanaka via cfe-commits wrote:
>> Author: ahatanak
>> Date: Mon Jan 11 11:22:01 2016
>> New Revision: 257357
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=257357&view=rev
>> Log:
>> [Sema] Issue a warning for integer overflow in struct initializer
>> 
>> Clang wasn't issuing a warning when compiling the following code:
>> 
>> struct s {
>>  unsigned x;
>> } s = {
>>  .x = 4 * 1024 * 1024 * 1024
>> };
> 
> Does this trigger in dead branches or not? Read: can you make sure it
> doesn't and add an appropiate case to the test, please?
> 
> Joerg
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org <mailto:cfe-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits <http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160111/3b31af36/attachment.html>


More information about the cfe-commits mailing list