Build failure with glibc-2.43
Categories
(NSS :: Build, defect, P3)
Tracking
(Not tracked)
People
(Reporter: rudi, Assigned: jschanck)
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.2 Safari/605.1.15
Steps to reproduce:
Patch to 3.120 to fix the error assignment discards 'const' qualifier from pointer is below
From fdf0a91b19b4cb5616c596faa372ae4365839225 Mon Sep 17 00:00:00 2001
From: Rudi Heitbaum <rudi@heitbaum.com>
Date: Sun, 25 Jan 2026 03:32:16 +0000
Subject: [PATCH] Fix build with glibc-2.43 assignment discards 'const'
qualifier from pointer
Fixes:
In file included from lowhash_vector.c:65:
genload.c: In function 'loader_LoadLibInReferenceDir':
genload.c:92:7: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
92 | c = strrchr(referencePath, PR_GetDirectorySeparator());
| ^
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
lib/freebl/genload.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/freebl/genload.c b/lib/freebl/genload.c
index 832deb58c..e3231e3e5 100644
--- a/lib/freebl/genload.c
+++ b/lib/freebl/genload.c
@@ -85,7 +85,7 @@ loader_LoadLibInReferenceDir(const char* referencePath, const char* name)
{
PRLibrary* dlh = NULL;
char* fullName = NULL;
- char* c;
-
const char* c;
PRLibSpec libSpec;/* Remove the trailing filename from referencePath and add the new one */
--
2.51.0
Actual results:
In file included from lowhash_vector.c:65:
genload.c: In function 'loader_LoadLibInReferenceDir':
genload.c:92:7: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
92 | c = strrchr(referencePath, PR_GetDirectorySeparator());
| ^
Expected results:
Successful compile
From fdf0a91b19b4cb5616c596faa372ae4365839225 Mon Sep 17 00:00:00 2001
From: Rudi Heitbaum <rudi@heitbaum.com>
Date: Sun, 25 Jan 2026 03:32:16 +0000
Subject: [PATCH] Fix build with glibc-2.43 assignment discards 'const'
qualifier from pointer
Fixes:
In file included from lowhash_vector.c:65:
genload.c: In function 'loader_LoadLibInReferenceDir':
genload.c:92:7: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
92 | c = strrchr(referencePath, PR_GetDirectorySeparator());
| ^
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
---
lib/freebl/genload.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/freebl/genload.c b/lib/freebl/genload.c
index 832deb58c..e3231e3e5 100644
--- a/lib/freebl/genload.c
+++ b/lib/freebl/genload.c
@@ -85,7 +85,7 @@ loader_LoadLibInReferenceDir(const char* referencePath, const char* name)
{
PRLibrary* dlh = NULL;
char* fullName = NULL;
- char* c;
+ const char* c;
PRLibSpec libSpec;
/* Remove the trailing filename from referencePath and add the new one */
--
2.51.0
jschanck@mozilla.com - could I ask for your assistance again to submit this to hg?
| Assignee | ||
Updated•3 months ago
|
Further background.
Since glibc-2.43:
For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr, strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return pointers into their input arrays now have definitions as macros that return a pointer to a const-qualified type when the input argument is a pointer to a const-qualified type.
https://lists.gnu.org/archive/html/info-gnu/2026-01/msg00005.html
| Assignee | ||
Comment 4•3 months ago
|
||
Fixes:
In file included from lowhash_vector.c:65:
genload.c: In function 'loader_LoadLibInReferenceDir':
genload.c:92:7: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
92 | c = strrchr(referencePath, PR_GetDirectorySeparator());
| ^
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
| Assignee | ||
Updated•3 months ago
|
Pushed by jschanck@mozilla.com:
https://hg.mozilla.org/projects/nss/rev/1d79026b7857
fix build with glibc-2.43 assignment discards 'const' qualifier from pointer. r=nss-reviewers,keeler
Description
•