This change fixes a stringop-truncation warning in pa.c.

Tested on hppa-unknown-linux-gn, hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11.

Committed to trunk.

Dave
-- 

Use memcpy instead of strncpy to avoid error with -Werror=stringop-truncation.

gcc/ChangeLog:

        * config/pa/pa.c (import_milli): Use memcpy instead of strncpy.

diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index d7fcd11e504..46194ba395d 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -5950,7 +5950,7 @@ import_milli (enum millicodes code)
     {
       imported[(int) code] = 1;
       strcpy (str, import_string);
-      strncpy (str + MILLI_START, milli_names[(int) code], 4);
+      memcpy (str + MILLI_START, milli_names[(int) code], 4);
       output_asm_insn (str, 0);
     }
 }

Reply via email to