This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]