Skip to content

Fix the compilation errors in gcc-10 with -Werror=ignored-qualifiers option and remove unused lines related to alloca#26

Merged
zandbelt merged 2 commits intoOpenIDC:version-0.6.2.xfrom
s-ymgch228:fix-builderror
May 30, 2025
Merged

Fix the compilation errors in gcc-10 with -Werror=ignored-qualifiers option and remove unused lines related to alloca#26
zandbelt merged 2 commits intoOpenIDC:version-0.6.2.xfrom
s-ymgch228:fix-builderror

Conversation

@s-ymgch228
Copy link

I found a build error and unused header file.

1. -Werror=ignored-qualifiers

hidden/cjose/src/jwk.c:1005:1: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
1005 | const cjose_jwk_ec_curve cjose_jwk_EC_get_curve(const cjose_jwk_t *jwk, cjose_err *err)
     | ^~~~~

Currently, cjose_jwk_ec_curve is an enumeration so it seems that const qualifier can not be used.

cjose/include/cjose/jwk.h

Lines 216 to 226 in b8f607d

typedef enum
{
/** NIST P-256 Prime Curve (secp256r1) */
CJOSE_JWK_EC_P_256 = NID_X9_62_prime256v1,
/** NIST P-384 Prime Curve (secp384r1) */
CJOSE_JWK_EC_P_384 = NID_secp384r1,
/** NIST P-521 Prime Curve (secp521r1) */
CJOSE_JWK_EC_P_521 = NID_secp521r1,
/** Invalid Curve */
CJOSE_JWK_EC_INVALID = -1
} cjose_jwk_ec_curve;

alloca

alloca() was used in src/concatkdf.c but it is no longer used after #15

Shoichi Yamaguchi added 2 commits May 30, 2025 06:04
This error is appeared in gcc10 with
`-Werror=ignored-qualifiers` option.
`alloca` is no longer used after the following pull-request.

- OpenIDC#15
@@ -12,19 +12,12 @@
#include <malloc.h>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This malloc.h may be unneeded, too. (I don't have _WIN32 host.)

@zandbelt zandbelt merged commit e2518d5 into OpenIDC:version-0.6.2.x May 30, 2025
9 checks passed
zandbelt added a commit that referenced this pull request May 31, 2025
Fix the compilation errors in gcc-10 with `-Werror=ignored-qualifiers` option and remove unused lines related to alloca
zandbelt added a commit that referenced this pull request May 31, 2025
Signed-off-by: Hans Zandbelt <hans.zandbelt@openidc.com>
zandbelt added a commit that referenced this pull request May 31, 2025
Signed-off-by: Hans Zandbelt <hans.zandbelt@openidc.com>
zandbelt added a commit that referenced this pull request Jun 12, 2025
see: #26 (review)

Signed-off-by: Hans Zandbelt <hans.zandbelt@openidc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants