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

Leave platform-specific type in operator def.n #341

Closed

Conversation

gabrielschulhof
Copy link
Contributor

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: #337

@gabrielschulhof
Copy link
Contributor Author

CI (v11.x): https://ci.nodejs.org/view/x%20-%20Abi%20stable%20module%20API/job/node-test-node-addon-api/680/

@gabrielschulhof
Copy link
Contributor Author

CI (v10.x): https://ci.nodejs.org/job/node-test-node-addon-api/682/
CI (v8.x): https://ci.nodejs.org/job/node-test-node-addon-api/683/
CI (v6.x): https://ci.nodejs.org/job/node-test-node-addon-api/684/

@mhdawson
Copy link
Member

After discussion with Gabriel, it seems that changing the type only shifts which cases we'd have to cast so it better to just add a cast to the test.

Explicitly casting to `uint32_t` prevents a template resolution
ambiguity on 32-bit platforms.

Fixes: nodejs#337
Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@NickNaso NickNaso left a comment

Choose a reason for hiding this comment

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

LGTM

mhdawson pushed a commit that referenced this pull request Sep 18, 2018
Explicitly casting to `uint32_t` prevents a template resolution
ambiguity on 32-bit platforms.

Fixes: #337

PR-URL: #341
Fixes: #337
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Nicola Del Gobbo <[email protected]>
@mhdawson
Copy link
Member

Landed as 2ad47a8

@mhdawson mhdawson closed this Sep 18, 2018
@gabrielschulhof gabrielschulhof deleted the 337-fix-ubuntu-error branch December 27, 2018 18:01
@gabrielschulhof gabrielschulhof restored the 337-fix-ubuntu-error branch December 28, 2018 20:27
@gabrielschulhof gabrielschulhof deleted the 337-fix-ubuntu-error branch February 13, 2019 23:28
kevindavies8 added a commit to kevindavies8/node-addon-api-Develop that referenced this pull request 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 <[email protected]>
Reviewed-By: Nicola Del Gobbo <[email protected]>
Marlyfleitas added a commit to Marlyfleitas/node-api-addon-Development that referenced this pull request 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 <[email protected]>
Reviewed-By: Nicola Del Gobbo <[email protected]>
wroy7860 added a commit to wroy7860/addon-api-benchmark-node that referenced this pull request 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 <[email protected]>
Reviewed-By: Nicola Del Gobbo <[email protected]>
johnfrench3 pushed a commit to johnfrench3/node-addon-api-git that referenced this pull request 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 <[email protected]>
Reviewed-By: Nicola Del Gobbo <[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 this pull request may close these issues.

Failure on ubuntu 32 after latest lands
3 participants