Blame SOURCES/str-trunc-warn.patch

4496ab
Index: acpica-unix2-20180209/source/compiler/aslanalyze.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180209.orig/source/compiler/aslanalyze.c
4496ab
+++ acpica-unix2-20180209/source/compiler/aslanalyze.c
4496ab
@@ -355,11 +355,16 @@ AnCheckMethodReturnValue (
4496ab
          */
4496ab
         if (ThisNodeBtype != 0)
4496ab
         {
4496ab
-            sprintf (MsgBuffer,
4496ab
+	     int cnt;
4496ab
+	     char *strp;
4496ab
+
4496ab
+            cnt = asprintf (&strp,
4496ab
                 "Method returns [%s], %s operator requires [%s]",
4496ab
                 StringBuffer, OpInfo->Name, StringBuffer2);
4496ab
 
4496ab
-            AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, MsgBuffer);
4496ab
+            AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgOp, strp);
4496ab
+	     if (cnt > 0)
4496ab
+	         free(strp);
4496ab
         }
4496ab
     }
4496ab
 }
4496ab
Index: acpica-unix2-20180209/source/compiler/aslpredef.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180209.orig/source/compiler/aslpredef.c
4496ab
+++ acpica-unix2-20180209/source/compiler/aslpredef.c
4496ab
@@ -159,14 +159,19 @@ ApCheckForPredefinedMethod (
4496ab
         if (MethodInfo->NumReturnNoValue &&
4496ab
             ThisName->Info.ExpectedBtypes)
4496ab
         {
4496ab
+	     int cnt;
4496ab
+	     char *strp;
4496ab
+
4496ab
             AcpiUtGetExpectedReturnTypes (StringBuffer,
4496ab
                 ThisName->Info.ExpectedBtypes);
4496ab
 
4496ab
-            sprintf (MsgBuffer, "%s required for %4.4s",
4496ab
-                StringBuffer, ThisName->Info.Name);
4496ab
+            cnt = asprintf (&strp, "%s required for %4.4s",
4496ab
+	        StringBuffer, ThisName->Info.Name);
4496ab
 
4496ab
             AslError (ASL_WARNING, ASL_MSG_RESERVED_RETURN_VALUE, Op,
4496ab
-                MsgBuffer);
4496ab
+                strp);
4496ab
+	     if (cnt > 0)
4496ab
+	        free(strp);
4496ab
         }
4496ab
         break;
4496ab
     }
4496ab
@@ -698,18 +703,26 @@ TypeErrorExit:
4496ab
 
4496ab
     AcpiUtGetExpectedReturnTypes (StringBuffer, ExpectedBtypes);
4496ab
 
4496ab
-    if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
4496ab
-    {
4496ab
-        sprintf (MsgBuffer, "%4.4s: found %s, %s required",
4496ab
-            PredefinedName, TypeName, StringBuffer);
4496ab
-    }
4496ab
-    else
4496ab
     {
4496ab
-        sprintf (MsgBuffer, "%4.4s: found %s at index %u, %s required",
4496ab
-            PredefinedName, TypeName, PackageIndex, StringBuffer);
4496ab
+        int cnt;
4496ab
+	char *strp;
4496ab
+
4496ab
+        if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
4496ab
+        {
4496ab
+            cnt = asprintf (&strp, "%4.4s: found %s, %s required",
4496ab
+                PredefinedName, TypeName, StringBuffer);
4496ab
+        }
4496ab
+        else
4496ab
+        {
4496ab
+            cnt = asprintf (&strp, "%4.4s: found %s at index %u, %s required",
4496ab
+                PredefinedName, TypeName, PackageIndex, StringBuffer);
4496ab
+        }
4496ab
+
4496ab
+        AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op, strp);
4496ab
+	if (cnt > 0)
4496ab
+	    free(strp);
4496ab
     }
4496ab
 
4496ab
-    AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op, MsgBuffer);
4496ab
     return (AE_TYPE);
4496ab
 }
4496ab
 
4496ab
Index: acpica-unix2-20180209/source/compiler/aslwalks.c
4496ab
===================================================================
4496ab
--- acpica-unix2-20180209.orig/source/compiler/aslwalks.c
4496ab
+++ acpica-unix2-20180209/source/compiler/aslwalks.c
4496ab
@@ -507,15 +507,19 @@ AnOperandTypecheckWalkEnd (
4496ab
             else if (!CommonBtypes)
4496ab
             {
4496ab
                 /* No match -- this is a type mismatch error */
4496ab
+		int cnt;
4496ab
+		char *strp;
4496ab
 
4496ab
                 AnFormatBtype (StringBuffer, ThisNodeBtype);
4496ab
                 AnFormatBtype (StringBuffer2, RequiredBtypes);
4496ab
 
4496ab
-                sprintf (MsgBuffer, "[%s] found, %s operator requires [%s]",
4496ab
+                cnt = asprintf (&strp, "[%s] found, %s operator requires [%s]",
4496ab
                     StringBuffer, OpInfo->Name, StringBuffer2);
4496ab
 
4496ab
                 AslError (ASL_ERROR, ASL_MSG_INVALID_TYPE,
4496ab
-                    ArgOp, MsgBuffer);
4496ab
+                    ArgOp, strp);
4496ab
+		if (cnt > 0)
4496ab
+		    free(strp);
4496ab
             }
4496ab
 
4496ab
         NextArgument: