-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(stlink): patch the incorrect calloc argument order
With the update to GCC 14, stlink v1.8.0 is broken, as GCC 14 enforces the correct argument order of calloc. This commit adds a little patch to resolve that issue for now. This patch should be removed and stlink updated to v1.8.1 as soon as that version gets released.
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
pkgs/development/tools/misc/stlink/calloc-argument-order.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From 7781732b0e09104d19c1f8476f1851760f4fa5fa Mon Sep 17 00:00:00 2001 | ||
From: Jan Philipp Tebernum <[email protected]> | ||
Date: Sat, 28 Dec 2024 01:59:20 +0100 | ||
Subject: [PATCH] fix: correct argument order for calloc | ||
|
||
--- | ||
src/stlink-lib/chipid.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/src/stlink-lib/chipid.c b/src/stlink-lib/chipid.c | ||
index c115089..0a6a4e9 100644 | ||
--- a/src/stlink-lib/chipid.c | ||
+++ b/src/stlink-lib/chipid.c | ||
@@ -65,7 +65,7 @@ void process_chipfile(char *fname) { | ||
return; | ||
} | ||
|
||
- ts = calloc(sizeof(struct stlink_chipid_params), 1); | ||
+ ts = calloc(1, sizeof(struct stlink_chipid_params)); | ||
|
||
while (fgets(buf, sizeof(buf), fp) != NULL) { | ||
|
||
-- | ||
2.47.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters