From 56d67dac2eebf44b2d34e9aba13359e3e3947975 Mon Sep 17 00:00:00 2001 From: Daniel Anselmi Date: Mon, 18 Aug 2025 23:17:09 +0200 Subject: [PATCH] flash/nor/max32: fix: call to calloc With gcc 15.2.1 we get the following error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument. Change-Id: Ib34d758bc09d34d86d29dd02ea9c7f05b1e83327 Signed-off-by: Daniel Anselmi Reviewed-on: https://review.openocd.org/c/openocd/+/9014 Reviewed-by: zapb Tested-by: jenkins Reviewed-by: Antonio Borneo --- src/flash/nor/max32xxx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flash/nor/max32xxx.c b/src/flash/nor/max32xxx.c index ed6083441..e91b9b67d 100644 --- a/src/flash/nor/max32xxx.c +++ b/src/flash/nor/max32xxx.c @@ -113,7 +113,7 @@ FLASH_BANK_COMMAND_HANDLER(max32xxx_flash_bank_command) return ERROR_FLASH_BANK_INVALID; } - info = calloc(sizeof(struct max32xxx_flash_bank), 1); + info = calloc(1, sizeof(struct max32xxx_flash_bank)); COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], info->flash_size); COMMAND_PARSE_NUMBER(u32, CMD_ARGV[6], info->flc_base); COMMAND_PARSE_NUMBER(u32, CMD_ARGV[7], info->sector_size);