PING [PATCH] drop weakref attribute on function definitions (PR 92799)

Martin Sebor msebor@gmail.com
Fri Feb 21 16:50:00 GMT 2020


Ping: https://gcc.gnu.org/ml/gcc-patches/2020-02/msg00883.html

On 2/14/20 3:41 PM, Martin Sebor wrote:
> Because attribute weakref introduces a kind of a definition, it can
> only be applied to declarations of symbols that are not defined.  GCC
> normally issues a warning when the attribute is applied to a defined
> symbol, but PR 92799 shows that it misses some cases on which it then
> leads to an ICE.
> 
> The ICE was introduced in GCC 4.5.  Prior to then, GCC accepted such
> invalid definitions and silently dropped the weakref attribute.
> 
> The attached patch avoids the ICE while again dropping the invalid
> attribute from the definition, except with the (now) usual warning.
> 
> Tested on x86_64-linux.
> 
> I also looked for code bases that make use of attribute weakref to
> rebuild them as another test but couldn't find any.  (There are
> a couple of instances in the Linux kernel but they look #ifdef'd
> out).  Does anyone know of any that do use it that I could try to
> build on Linux?
> 
> Martin



More information about the Gcc-patches mailing list