This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
On 26 January 2016 at 00:45, Prasad Ghangal <prasad.ghangal@gmail.com> wrote:
> Hi!
>
> I would like to solve "Bug 17896 - The expression (a>0 & b>0) should
> give clearer warning message (-Wparentheses)"
> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17896) but I am new to
> gcc internals.
>
> Can someone please guide me how to do it?
You would perhaps need to modify c-common.c:warn_about_parentheses ().
my untested patch gives:
f.c: In function âmainâ:
f.c:5:13: warning: suggest && instead of & [-Wparentheses]
if (a > b & a > c)
^
You will probably need to extend along similar lines.
Thanks,
Prathamesh
>
> --
> Thanks and Regards,
> Prasad Ghangal
Attachment:
paren.diff
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |