[PATCH 2/2] [MSP430] Fix issues handling .persistent attribute (PR 78818)

Martin Sebor msebor@gmail.com
Thu May 18 16:08:00 GMT 2017


On 05/17/2017 09:45 AM, Jozef Lawrynowicz wrote:
> Add warning to back end and add test.
>
> Patch is attached.
>
> If the patch is acceptable, I would appreciate if someone could commit
> it for me as I do not have write access.
>
> 2017-05-XX Jozef Lawrynowicz <jozef.l@somniumtech.com>
>     gcc/
>     PR target/78818
>     * config/msp430/msp430.c (msp430_unique_section): Warn if .persistent
>     attribute is used on an automatic variable.

+  if (!message && TREE_NAME_EQ (name, ATTR_PERSIST) && !TREE_STATIC (* 
node)
+      && !TREE_PUBLIC (* node) && !DECL_EXTERNAL (* node))
+    message = "%qE attribute has no effect on automatic variables";

In code like this (both existing and new) where the format string
is being assigned to a pointer that is then passed to one of the
diagnostic functions, I believe the string literal needs to wrapped
in G_() so that it can be translated.

Martin



More information about the Gcc-patches mailing list