public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Marek Polacek <polacek@redhat.com>
Cc: "Joseph S. Myers" <joseph@codesourcery.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
		Jason Merrill <jason@redhat.com>,
	Jakub Jelinek <jakub@redhat.com>
Subject: Re: [C PATCH] Improve locinfo a bit (PR c/59846)
Date: Thu, 23 Jan 2014 23:18:00 -0000	[thread overview]
Message-ID: <CAMe9rOq-ca+4KGPjnLN=M-meRqK+v3wWm9h-subw0ZihhgRykw@mail.gmail.com> (raw)
In-Reply-To: <20140123184416.GZ8907@redhat.com>

On Thu, Jan 23, 2014 at 10:44 AM, Marek Polacek <polacek@redhat.com> wrote:
> On Thu, Jan 23, 2014 at 05:50:23PM +0000, Joseph S. Myers wrote:
>> On Thu, 23 Jan 2014, Marek Polacek wrote:
>>
>> > shorten_compare can produce a better locinfo if we pass location
>> > from {,cp_}build_binary_op to it; op0/op1 there don't have location.
>> > Furthermore, I see no reason why use input_location in
>> > parser_build_binary_op when we can use more accurate location.
>> >
>> > I don't know if/how I can test the column info using dejagnu, so
>> > no testcase attached.  But to give you an idea, instead of
>>
>> The approach used is
>>
>> /* { dg-warning "14:comparison is always false" } */
>>
>> or similar, with the column number put at the start of the dg-error /
>> dg-warning text.
>
> Argh, not sure how I missed that.  So with a testcase this time.
>
> OK now?
>
> 2014-01-23  Marek Polacek  <polacek@redhat.com>
>
>         PR c/59846
> c-family/
>         * c-common.c (shorten_compare): Add location_t parameter.
>         * c-common.h (shorten_binary_op): Adjust declaration.
> cp/
>         * typeck.c (cp_build_binary_op): Pass location to shorten_compare.
> c/
>         * c-typeck.c (parser_build_binary_op): Use location instead of
>         input_location.
>         (build_binary_op): Pass location to shorten_compare.
> testsuite/
>         * gcc.dg/pr59846.c: New test.
>

It failed on Linux/x86:

FAIL: gcc.dg/pr59846.c (test for excess errors)
FAIL: gcc.dg/pr59846.c  (test for warnings, line 14)
FAIL: gcc.dg/pr59846.c  (test for warnings, line 8)

-- 
H.J.

  parent reply	other threads:[~2014-01-23 23:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-23 16:37 Marek Polacek
2014-01-23 17:50 ` Joseph S. Myers
2014-01-23 18:45   ` Marek Polacek
2014-01-23 20:53     ` Joseph S. Myers
2014-01-23 23:18     ` H.J. Lu [this message]
2014-01-23 23:27       ` Marek Polacek
2014-01-24 15:07     ` Andreas Schwab
2014-01-24 17:01       ` Marek Polacek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMe9rOq-ca+4KGPjnLN=M-meRqK+v3wWm9h-subw0ZihhgRykw@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jason@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=polacek@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).