Skip to content

FTBS with gcc 14.2: error: format '%p' expects argument of type 'void *', but argument 3 has type 'JSVarRef *' [-Werror=format=] #872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nE0sIghT opened this issue Feb 1, 2025 · 1 comment · Fixed by #873

Comments

@nE0sIghT
Copy link
Contributor

nE0sIghT commented Feb 1, 2025

Hi!

I tried to build quickjs-ng as a submodule in the my cmake project with GCC 14.2 and got errors (it looks like due to -Werror in the CMakeLists.txt):

.../quickjs.c: In function 'js_create_module_bytecode_function':
.../quickjs.c:27136:35: error: format '%p' expects argument of type 'void *', but argument 3 has type 'JSVarRef *' [-Werror=format=]
27136 |                 module_trace(ctx, "local %d: %p\n", i, var_ref);
      |                                   ^~~~~~~~~~~~~~~~     ~~~~~~~
      |                                                        |
      |                                                        JSVarRef *
.../quickjs.c:27044:15: note: in definition of macro 'module_trace'
27044 |        printf(__VA_ARGS__); \
      |               ^~~~~~~~~~~
.../quickjs.c:27136:47: note: format string is defined here
27136 |                 module_trace(ctx, "local %d: %p\n", i, var_ref);
      |                                              ~^
      |                                               |
      |                                               void *
.../quickjs.c: In function 'js_inner_module_linking':
.../quickjs.c:27347:39: error: format '%p' expects argument of type 'void *', but argument 2 has type 'JSVarRef *' [-Werror=format=]
27347 |                     module_trace(ctx, "local export (var_ref=%p)\n", var_ref);
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~
      |                                                                      |
      |                                                                      JSVarRef *
.../quickjs.c:27044:15: note: in definition of macro 'module_trace'
27044 |        printf(__VA_ARGS__); \
      |               ^~~~~~~~~~~
.../quickjs.c:27347:63: note: format string is defined here
27347 |                     module_trace(ctx, "local export (var_ref=%p)\n", var_ref);
      |                                                              ~^
      |                                                               |
      |                                                               void *
cc1: all warnings being treated as errors
@saghul
Copy link
Contributor

saghul commented Feb 1, 2025

Thanks for the report! I guess we need to cast the pointer to void*. Would you like to send a PR?

nE0sIghT added a commit to nE0sIghT/quickjs that referenced this issue Feb 1, 2025

Verified

This commit was signed with the committer’s verified signature.
nE0sIghT Yuri Konotopov
Fixes: quickjs-ng#872

Signed-off-by: Yuri Konotopov <[email protected]>
saghul pushed a commit that referenced this issue Feb 1, 2025
Fixes: #872

Signed-off-by: Yuri Konotopov <[email protected]>
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 a pull request may close this issue.

2 participants