RFC: c-common PATCHes to fully fold warning function arguments

Jason Merrill jason@redhat.com
Wed Dec 2 18:11:00 GMT 2015


On 12/02/2015 12:50 PM, Joseph Myers wrote:
> On Wed, 2 Dec 2015, Jason Merrill wrote:
>
>> As richi pointed out in another thread, calling fold in warn_tautological_cmp
>> is problematic because fold expects operands of its argument to have already
>> been folded; we really need to call *_fully_fold.
>>
>> The first patch moves c_fully_fold into the C front end, and defines it for
>> C++ as well.
>
> The new file needs copyright and license notices.

So it does, thanks.

>> The second patch defines fold_for_warn to call c_fully_fold and uses it in
>> places in the warn_* functions that want to know if the operand has a constant
>> value.
>>
>> Joseph, are these changes OK for C?  The extra folding isn't currently
>> necessary for C, should fold_for_warn check c_dialect_cxx()?
>
> I think it should check that, yes.

Done.

Are these OK?

Jason

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fully_fold.patch
Type: text/x-patch
Size: 43892 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151202/0d752a58/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fold_for_warn.patch
Type: text/x-patch
Size: 5805 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151202/0d752a58/attachment-0001.bin>


More information about the Gcc-patches mailing list