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

Closed
@nE0sIghT

Description

@nE0sIghT

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions