This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v2] Add sanopt support for UBSAN_PTR.
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Martin Liška <mliska at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 6 Oct 2017 14:10:47 +0200
- Subject: Re: [PATCH v2] Add sanopt support for UBSAN_PTR.
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jakub at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AEB8820271
- References: <83817c1e-3138-13d7-1dde-6f72ca8f4ab9@suse.cz> <20171004180612.GZ18588@tucnak> <1253289e-e94b-fcbe-2e36-e9434cabfe3d@suse.cz> <20171006084027.GK18588@tucnak> <c9ddf321-566e-2795-def7-d538bf0f3b45@suse.cz> <20171006105341.GN18588@tucnak> <5fddc37c-b745-0bbd-daef-a8f02cc64d3b@suse.cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Oct 06, 2017 at 01:43:20PM +0200, Martin Liška wrote:
> Thanks for feedback, all resolved except this one:
>
> ../../gcc/sanopt.c:561:3: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
> ; /* Don't record base_addr + expr_offset, it's not a guarding
> ^
Ah, indeed (unlike for if (...) /* comment */; ).
So perhaps do if (!cond) /* comment */; else { ... }
instead of if (cond) { ... } else /* comment */; ?
Or put the else stuff into the comment.
I certainly can't find a single occurence of the else {} idiom
in gcc/*.[ch].
But with the multi-line {} I guess I can live with it too.
So, if it passes bootstrap/regtest, ok for trunk, with or without
the above suggested change.
Jakub