Title: C4244 compiler warnings: type conversions causing possible loss of data · Issue #3 · magiclen/node-stringbuilder · GitHub
Open Graph Title: C4244 compiler warnings: type conversions causing possible loss of data · Issue #3 · magiclen/node-stringbuilder
X Title: C4244 compiler warnings: type conversions causing possible loss of data · Issue #3 · magiclen/node-stringbuilder
Description: As pointed out in a closed issue, compiling for electron using: node-gyp rebuild --target=3.0.6 --arch=x64 --dist-url=https://atom.io/download/electron causes many C4244 warnings. These seem benign, as the compiler does implicit type con...
Open Graph Description: As pointed out in a closed issue, compiling for electron using: node-gyp rebuild --target=3.0.6 --arch=x64 --dist-url=https://atom.io/download/electron causes many C4244 warnings. These seem benign...
X Description: As pointed out in a closed issue, compiling for electron using: node-gyp rebuild --target=3.0.6 --arch=x64 --dist-url=https://atom.io/download/electron causes many C4244 warnings. These seem benign...
Opengraph URL: https://github.com/magiclen/node-stringbuilder/issues/3
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"C4244 compiler warnings: type conversions causing possible loss of data","articleBody":"As pointed out in a closed issue, compiling for electron using:\r\n node-gyp rebuild --target=3.0.6 --arch=x64 --dist-url=https://atom.io/download/electron \r\ncauses many C4244 warnings.\r\n\r\nThese seem benign, as the compiler does implicit type conversions.\r\nI nevertheless suppressed these warnings by using casts in the code for node-stringbuilder.c\r\neg: buffer[resultListLength++] = (uint32_t)starePointer + 1; // approx line 73\r\n buffer[resultListLength++] = (uint32_t)starePointer + 1; // approx line 133\r\n buffer[resultListLength++] = (uint32_t)sourcePointer + 1; // approx line 250\r\n int64_t log2Floor(int64_t n) {return (int64_t) (floor(log2((double)n))); // approx line 488\r\n int64_t addedLength = (int64_t) pow((double)2, (double)(i - 1)) * contentBufferLength; // 848\r\n int64_t realAddedCount = (int64_t)pow((double)2, (double)log2Count); // approx 851\r\n int64_t addedLength = (int64_t)pow((double)2,(double)( i - 1)) * originalLength; // approx 1188\r\n int64_t realAddedCount = (int64_t)pow((double)2, (double)log2Count); // approx 1191\r\n\r\nBut these explicit casts are probably not necessary, and whether they'd impact on performance anyway I'm not sure. \r\n\r\n\r\n","author":{"url":"https://github.com/xthdraft","@type":"Person","name":"xthdraft"},"datePublished":"2018-11-14T01:51:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/3/node-stringbuilder/issues/3"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0c186390-66f5-e8fb-1e32-962169967d67 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E2D4:2445E2:31C2CB2:4145E48:696DB8AA |
| html-safe-nonce | 145f5ce2130a000e7f54134ea44e9cb67c9b456d96b45251fff6e14bfb73c8d6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMkQ0OjI0NDVFMjozMUMyQ0IyOjQxNDVFNDg6Njk2REI4QUEiLCJ2aXNpdG9yX2lkIjoiNTk5MDEzMTA5MDY3MDMzNjE3MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8d3107b8633714bf05a91ec4953e3e1dbb642646d4d72393b6c68f38847db247 |
| hovercard-subject-tag | issue:380501290 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/magiclen/node-stringbuilder/3/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4f46d5821ca1c106d12dd4b125ec26d3788645134fcee1328bfc1a9115d0486f/magiclen/node-stringbuilder/issues/3 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4f46d5821ca1c106d12dd4b125ec26d3788645134fcee1328bfc1a9115d0486f/magiclen/node-stringbuilder/issues/3 |
| og:image:alt | As pointed out in a closed issue, compiling for electron using: node-gyp rebuild --target=3.0.6 --arch=x64 --dist-url=https://atom.io/download/electron causes many C4244 warnings. These seem benign... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | xthdraft |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4922b452d03cd8dbce479d866a11bc25b59ef6ee2da23aa9b0ddefa6bd4d0064 |
| turbo-cache-control | no-preview |
| go-import | github.com/magiclen/node-stringbuilder git https://github.com/magiclen/node-stringbuilder.git |
| octolytics-dimension-user_id | 5851348 |
| octolytics-dimension-user_login | magiclen |
| octolytics-dimension-repository_id | 94566134 |
| octolytics-dimension-repository_nwo | magiclen/node-stringbuilder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 94566134 |
| octolytics-dimension-repository_network_root_nwo | magiclen/node-stringbuilder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7e5ae23c70136152637ceee8d6faceb35596ec46 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width