Skip to content
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

Failure on ubuntu 32 after latest lands #337

Closed
mhdawson opened this issue Sep 11, 2018 · 6 comments
Closed

Failure on ubuntu 32 after latest lands #337

mhdawson opened this issue Sep 11, 2018 · 6 comments

Comments

@mhdawson
Copy link
Member

First guess is that may have been caused by:#315 as I don't see changes in the napi-inl.h on line 798

https://ci.nodejs.org/view/x%20-%20Abi%20stable%20module%20API/job/node-test-node-addon-api/MACHINE=ubuntu1404-32/675/console

  CXX(target) Release/obj.target/binding/object/set_property.o
../object/object.cc: In function 'Napi::Value CreateObjectUsingMagic(const Napi::CallbackInfo&)':
../object/object.cc:129:6: error: ambiguous overload for 'operator[]' (operand types are 'Napi::Object' and 'int')
   obj[42] = 120;
      ^
../object/object.cc:129:6: note: candidates are:
../object/object.cc:129:6: note: operator[](napi_value, int) <built-in>
In file included from /home/iojs/build/workspace/node-test-node-addon-api/MACHINE/ubuntu1404-32/node-addon-api/napi.h:1564:0,
                 from ../object/object.cc:1:
/home/iojs/build/workspace/node-test-node-addon-api/MACHINE/ubuntu1404-32/node-addon-api/napi-inl.h:786:41: note: Napi::Object::PropertyLValue<unsigned int> Napi::Object::operator[](uint32_t)
 inline Object::PropertyLValue<uint32_t> Object::operator [](uint32_t index) {
                                         ^
/home/iojs/build/workspace/node-test-node-addon-api/MACHINE/ubuntu1404-32/node-addon-api/napi-inl.h:798:14: note: Napi::Value Napi::Object::operator[](uint32_t) const
 inline Value Object::operator [](uint32_t index) const {
              ^
make: *** [Release/obj.target/binding/object/object.o] Error 1
make: *** Waiting for unfinished jobs....
@mhdawson
Copy link
Member Author

@gabrielschulhof
Copy link
Contributor

gabrielschulhof commented Sep 11, 2018 via email

@gabrielschulhof
Copy link
Contributor

@mhdawson I was able to build successfully on Ubuntu 14.04 with gcc 4.8.4 (4.8.4-2ubuntu1~14.04.3). What version of gcc is present on the test machine?

@mhdawson
Copy link
Member Author

mhdawson commented Sep 11, 2018

iojs@test-digitalocean-ubuntu1404-x86-1:~$ gcc --version
gcc (Ubuntu 4.9.4-2ubuntu1~14.04.1) 4.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE

@mhdawson
Copy link
Member Author

Was the ubuntu you had 32 bit? That seems to be one thing that is different as well.

@gabrielschulhof
Copy link
Contributor

Reproduced locally.

gabrielschulhof pushed a commit to gabrielschulhof/node-addon-api that referenced this issue Sep 12, 2018
The property get/set sugar for numerical indices has to stay platform-
agnostic. That is, we cannot use `uint32_t`, but must instead use `int`
in the operator definition, because `int` resolves exactly on both
32-bit and 64-bit platforms.

Fixes: nodejs#337
gabrielschulhof pushed a commit to gabrielschulhof/node-addon-api that referenced this issue Sep 13, 2018
Explicitly casting to `uint32_t` prevents a template resolution
ambiguity on 32-bit platforms.

Fixes: nodejs#337
kevindavies8 added a commit to kevindavies8/node-addon-api-Develop that referenced this issue Aug 24, 2022
Explicitly casting to `uint32_t` prevents a template resolution
ambiguity on 32-bit platforms.

Fixes: nodejs/node-addon-api#337

PR-URL: nodejs/node-addon-api#341
Fixes: nodejs/node-addon-api#337
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@NickNaso.local>
Marlyfleitas added a commit to Marlyfleitas/node-api-addon-Development that referenced this issue Aug 26, 2022
Explicitly casting to `uint32_t` prevents a template resolution
ambiguity on 32-bit platforms.

Fixes: nodejs/node-addon-api#337

PR-URL: nodejs/node-addon-api#341
Fixes: nodejs/node-addon-api#337
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@NickNaso.local>
wroy7860 added a commit to wroy7860/addon-api-benchmark-node that referenced this issue Sep 19, 2022
Explicitly casting to `uint32_t` prevents a template resolution
ambiguity on 32-bit platforms.

Fixes: nodejs/node-addon-api#337

PR-URL: nodejs/node-addon-api#341
Fixes: nodejs/node-addon-api#337
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@NickNaso.local>
johnfrench3 pushed a commit to johnfrench3/node-addon-api-git that referenced this issue Aug 11, 2023
Explicitly casting to `uint32_t` prevents a template resolution
ambiguity on 32-bit platforms.

Fixes: nodejs/node-addon-api#337

PR-URL: nodejs/node-addon-api#341
Fixes: nodejs/node-addon-api#337
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@NickNaso.local>
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