public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kai Tietz <ktietz70@googlemail.com>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Jason Merrill <jason@redhat.com>,
		Richard Henderson <rth@redhat.com>
Subject: Re: [patch c,c++,i386]:PR/15774 - Conflicting function decls not diagnosed
Date: Wed, 22 Dec 2010 18:10:00 -0000	[thread overview]
Message-ID: <AANLkTim_9EicRtFLqY0O3Vxiised8-1Bu33bWSa8d54s@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimWp6d2PDLVmhodnU11_o5HPFSa3j0V+0-ALxEW@mail.gmail.com>

2010/12/22 Kai Tietz <ktietz70@googlemail.com>:
> 2010/12/22 Joseph S. Myers <joseph@codesourcery.com>:
>> On Wed, 22 Dec 2010, Kai Tietz wrote:
>>
>>> Well, a test is in PR, I can one explicit here, nevertheless we should
>>> have for this already enough tests in testsuite.
>>
>> What existing test in the testsuite fails before the patch and passes
>> after it, then?
>>
>> Among other things, the testsuite should verify that previous bugs do not
>> reappear.  That means that if you don't fix an existing failing test, you
>> should add a new one, that fails without the patch applied but passes once
>> it is applied.  And there should be tests covering as much of the patch as
>> possible; if you remove the new handling for any one of the attributes
>> there, that should cause a test failure.
>>
>>> For the rest of your reply, I can see a relation to the subject of the
>>> patch (and PR).
>>
>> Then please answer my points.  How does your patch cause the results on a
>> testcase to change from "no diagnostic" to "diagnostic"?  (If it doesn't
>> do so, please state the exact testcase, what the diagnostics are before
>> the patch, what they are afterwards, and why the new version is superior.)
>> Why do you need a new hook at all?  Why are you duplicating code already
>> present in the x86 back end that knows about what attributes are ABI
>> attributes relevant to compatibility?
>>
>> --
>> Joseph S. Myers
>> joseph@codesourcery.com
>>
>
> As this patch fixes a bug (as describe in the PR) in diagnostic output
> It doesn't change anything on the diagnostic logic of C, or C++.  As
> we usually (and this is a good habit) not checking the type output in
> testsuite, I expect here no regression. Nevertheless I can add one
> explicit checking complete error/warning message for C.
> ABI attributes changing calling-convention. This makes asignments of
> function pointers declaring different calling conventions (like for
> i386 regparm, stdcall, fastcall, thiscall, cdecl, sysv_abi, ms_abi)
> incompatible. This is (or should be) diagnosed by FE, as it is
> already. But the display of such a warning/error lacks those attribute
> information, why check failed.
>
> See following example:
> t.c:
> int foo(void);
> int bar(int (__attribute__ ((regparm(3))) *arg)(void));
> int doo(void)
> {
>  return bar(foo);
> }
>
> and simply compile it by gcc -c t.c
>
> You will see that the warning message produced looks like that
> (without the patch):
> t.c: In function 'doo':
> t.c:5:3: warning: passing argument 1 of 'bar' from incompatible
> pointer type [enabled by default]
> t.c:2:5: note: expected 'int (*)(void)' but argument is of type 'int (*)(void)'
>
> The patch I sent simply makes displayed message understandable why
> 'int (*)(void)' isn't 'int (*)(void)' by displaying the callabi
> attributes, which are actual the cause for the warning.
>
> Regards,
> Kai
>
> --
> |  (\_/) This is Bunny. Copy and paste
> | (='.'=) Bunny into your signature to help
> | (")_(") him gain world domination
>

PS: Use here 32-bit to get warnings displayed.

Regards,
Kai

  reply	other threads:[~2010-12-22 17:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-22 14:53 Kai Tietz
2010-12-22 14:58 ` Dave Korn
2010-12-22 15:11   ` Kai Tietz
2010-12-22 15:54     ` Gabriel Dos Reis
2010-12-22 16:21       ` Kai Tietz
2010-12-22 16:31         ` Gabriel Dos Reis
2010-12-22 16:38           ` Kai Tietz
2010-12-22 17:21 ` Joseph S. Myers
2010-12-22 17:38   ` Gabriel Dos Reis
2010-12-22 17:55   ` Kai Tietz
2010-12-22 17:57     ` Joseph S. Myers
2010-12-22 18:03       ` Kai Tietz
2010-12-22 18:10         ` Kai Tietz [this message]
2010-12-22 19:13         ` Joseph S. Myers
2010-12-22 18:24   ` Jason Merrill
2010-12-22 19:23     ` Kai Tietz
2010-12-22 19:25       ` Kai Tietz
2010-12-22 20:37         ` Kai Tietz
2010-12-23  8:19       ` Gabriel Dos Reis

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=AANLkTim_9EicRtFLqY0O3Vxiised8-1Bu33bWSa8d54s@mail.gmail.com \
    --to=ktietz70@googlemail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=rth@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).