Skip to content

Use of overloaded operator '[]' is ambiguous (with operand types 'CallbackInfo' and 'int') #1644

Closed

Description

@tallero

Hello,

while building c-kzg in order to then build lodestar on Life and DogeOS Android base (armv7l), I've encountered the issue reported in the title, the exact log and trigger can be found in the latter.

I've noticed the release notes for version 5.1 mentioned the specific component which triggers the issue so I've thought it had been fixed in that version (latest c-kzg 2.1.2 targets node-addon-api 5.0 still) so I've tried targetting that one in a proposed 2.1.3 version upgrade but apparently the issue is still there.

I'm pasting one of the errors reported by the compiler

In file included from /data/data/com.termux/files/home/nodejs-c-kzg-build/src/c-kzg-4844-f79c1b3ec89e78b574dae9e87f6f4c25c3f81363/bindings/node.js/node_modules/node-addon-api/napi.h:3112:
/data/data/com.termux/files/home/nodejs-c-kzg-build/src/c-kzg-4844-f79c1b3ec89e78b574dae9e87f6f4c25c3f81363/bindings/node.js/node_modules/node-addon-api/napi-inl.h:4082:47: error: use of overloaded operator '[]' is ambiguous (with operand types 'CallbackInfo' and 'int')
 4082 |     (instance->*cb)(callbackInfo, callbackInfo[0]);
      |                                   ~~~~~~~~~~~~^~

Here is the log for version 5.0 (triggered by lodestar)

and here is the one for version 5.1 (triggered by c-kzg)

I suppose since 5.1 it's a 2 year version you are not interested in fixing the bug, if it's not in c-kzg codebase, but since I don't know if between 5.1 and 6.0 there are incompatible ABI changes, I don't know, you may have wanted to know to release a 5.1.1 or something like that.

EDIT: I still don't know if there are ABI breaking changes from version 5 to 6, but it seems c-kzg builds with version 6.1.

Activity

  1. self-assigned this
    on Mar 2, 2025
  2. KevinEady commented on Mar 2, 2025

    @KevinEady
    Contributor

    This error was introduced in #1253 (released in v5.1.0), complained about in #1253 (comment) / #1272, and addressed in #1275 (released in v6.0.0)

    So to fix this error, either downgrade to 5.0.0, upgrade to 6+, or apply a patch of #1275 to a 5.1.0-based branch.

    Since this bug has already been addressed, closing issue. Please re-open if you feel this is in error.

    Thanks, Kevin

  3. tallero commented on Mar 2, 2025

    @tallero
    Author

    Thank you for having reported the existence of the patch.
    As you've said the issue had already been solved, yet I don't think it would be bad though if a minor 5.1.1 release including the patch happened though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions