Hi,
Fedora rawhide is now being built with GCC-14, which is doing additional 
checking and any warnings are flagged as errors in the fedora build system.  
Attached is a trivial patch that corrects the order of calloc parameters to 
avoid the following error:


pfmlib_s390x_cpumf.c: In function ‘pfm_cpumcf_init’:
pfmlib_s390x_cpumf.c:219:34: error: ‘calloc’ sizes specified with ‘sizeof’ in 
the earlier argument and not in the later argument 
[-Werror=calloc-transposed-args]
  219 |         cpumcf_pe = calloc(sizeof(*cpumcf_pe),
      |                                  ^


-Will Cohen
commit cb944829e0940d74009e09b8985b4f2139f5cb3b
Author: William Cohen <wco...@redhat.com>
Date:   Mon Jan 29 16:23:43 2024 -0500

    Correct s390x code to avoid GCC-14 -Werror=calloc-transposed-args errors

diff --git a/lib/pfmlib_s390x_cpumf.c b/lib/pfmlib_s390x_cpumf.c
index d8ce22d..718f5f8 100644
--- a/lib/pfmlib_s390x_cpumf.c
+++ b/lib/pfmlib_s390x_cpumf.c
@@ -216,8 +216,8 @@ static int pfm_cpumcf_init(void *this)
 		break;
 	}
 
-	cpumcf_pe = calloc(sizeof(*cpumcf_pe),
-			   cfvn_set_count + csvn_set_count + ext_set_count);
+	cpumcf_pe = calloc(cfvn_set_count + csvn_set_count + ext_set_count,
+			   sizeof(*cpumcf_pe));
 	if (cpumcf_pe == NULL)
 		return PFM_ERR_NOMEM;
 
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to