public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: gcc-patches@gcc.gnu.org, Jakub Jelinek <jakub@redhat.com>,
	"Joseph S. Myers" <joseph@codesourcery.com>,
	Marek Polacek <polacek@redhat.com>,
	Jason Merrill <jason@redhat.com>,
	Richard Biener <rguenther@suse.de>
Subject: Re: [PATCH] attribute copy, leaf, weakref and -Wmisisng-attributes (PR 88546)
Date: Thu, 03 Jan 2019 22:10:00 -0000	[thread overview]
Message-ID: <e584b9d5-e898-1c23-62a8-e0067948cada@gmail.com> (raw)
In-Reply-To: <2f0b2202-ba56-0554-1cc9-f290cda2a740@gmail.com>

Ping: https://gcc.gnu.org/ml/gcc-patches/2018-12/msg01616.html

(The first sentence in the second paragraph below should have
read "...independently of the question whether leaf should be
accepted on extern declarations.")

On 12/21/18 4:50 PM, Martin Sebor wrote:
> The first revision of the patch was missing a test and didn't
> completely or completely correctly handle attribute noreturn.
> Attached is an update with the test included and the omission
> and bug fixed.
> 
> I think it makes sense to consider the patch independently of
> the question whether weakrefs should be extern.  That change can
> be made separately, with only minor tweaks to the attribute copy
> handling and the warning.  None of the other fixes in this patch
> (precipitated by more thorough testing) should be affected by it.
> 
> Martin
> 
> On 12/20/18 8:45 PM, Martin Sebor wrote:
>> The enhancement to detect mismatched attributes between function
>> aliases and their targets triggers (expected) warnings in GCC
>> builds due to aliases being declared with fewer attributes than
>> their targets.
>>
>> Using attribute copy as recommended to copy the attributes from
>> the target to the alias triggers another warning, this time due
>> to applying attribute leaf to static functions (the attribute
>> only applies to extern functions).  This is due to an oversight
>> in both the handler for attribute copy and in
>> the -Wmissing-attributes warning.
>>
>> In addition, the copy attribute handler doesn't account for C11
>> _Noreturn and C++ throw() specifications, both of which set
>> the corresponding tree bits but don't attach the synonymous
>> attribute to it.  This also leads to warnings in GCC builds
>> (in libgfortran).
>>
>> The attached patch corrects all of these problems: the attribute
>> copy handler to avoid copying attribute leaf to declarations of
>> static functions, and to set the noreturn and nonthrow bits, and
>> the missing attribute warning to avoid triggering for static
>> weakref aliases whose targets are decorated wiwth attribute leaf.
>>
>> With this patch, GCC should build with no -Wmissing-attributes
>> warnings.
>>
>> Tested on x86_64-linux.
>>
>> Martin
> 

  parent reply	other threads:[~2019-01-03 22:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21  6:01 Martin Sebor
2018-12-21 10:28 ` Jakub Jelinek
2018-12-21 16:05   ` Martin Sebor
2018-12-21 19:14     ` Joseph Myers
2018-12-22  0:16 ` Martin Sebor
2018-12-22  0:33   ` Jakub Jelinek
2018-12-22  2:13     ` Martin Sebor
2019-01-03 22:10   ` Martin Sebor [this message]
2019-01-03 22:10   ` Martin Sebor
2019-01-04 18:10     ` Joseph Myers

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=e584b9d5-e898-1c23-62a8-e0067948cada@gmail.com \
    --to=msebor@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jason@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=polacek@redhat.com \
    --cc=rguenther@suse.de \
    /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).