Title: Test for the size of struct http_parser fails on 32 bit systems where there is padding/alignment for void* · Issue #526 · nodejs/http-parser · GitHub
Open Graph Title: Test for the size of struct http_parser fails on 32 bit systems where there is padding/alignment for void* · Issue #526 · nodejs/http-parser
X Title: Test for the size of struct http_parser fails on 32 bit systems where there is padding/alignment for void* · Issue #526 · nodejs/http-parser
Description: Bonjour, Porting http-parser to AIX, where there are 32 and 64 bit environments, there is a test on sizeof (struct http_parser) which fails due to 8 byte reservation for void* on both 32 and 64 bit compiles. A clean option might be to ch...
Open Graph Description: Bonjour, Porting http-parser to AIX, where there are 32 and 64 bit environments, there is a test on sizeof (struct http_parser) which fails due to 8 byte reservation for void* on both 32 and 64 bit...
X Description: Bonjour, Porting http-parser to AIX, where there are 32 and 64 bit environments, there is a test on sizeof (struct http_parser) which fails due to 8 byte reservation for void* on both 32 and 64 bit...
Opengraph URL: https://github.com/nodejs/http-parser/issues/526
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Test for the size of struct http_parser fails on 32 bit systems where there is padding/alignment for void*","articleBody":"Bonjour,\r\n\r\nPorting http-parser to AIX, where there are 32 and 64 bit environments, there is a test on sizeof (struct http_parser) which fails due to 8 byte reservation for void* on both 32 and 64 bit compiles.\r\n\r\nA clean option might be to change the void *data element of struct http_parser to be a union of uint64 and void*.\r\n\r\nBut this may not work if the 32 bit size of struct http_parser must remain at a total of 28 bytes (and in which case the test is in correct).\r\n\r\nHowever, supposing that this is an error in the test code, I provisionally used the following patch for the 32 bit build\r\n\r\n```\r\n--- ./test.c.ORIG 2020-11-27 22:02:53 +0100\r\n+++ ./test.c 2020-11-27 22:57:18 +0100\r\n@@ -4234,7 +4234,7 @@\r\n printf(\"http_parser v%u.%u.%u (0x%06lx)\\n\", major, minor, patch, version);\r\n \r\n printf(\"sizeof(http_parser) = %u\\n\", (unsigned int)sizeof(http_parser));\r\n- assert(sizeof(http_parser) == 4 + 4 + 8 + 2 + 2 + 4 + sizeof(void *));\r\n+ assert(sizeof(http_parser) == 4 + 4 + 8 + 2 + 2 + 4 + 2*sizeof(void *));\r\n \r\n //// API\r\n test_preserve_data();\r\n```\r\n\r\n\r\nWe would like to ask for your expert advice on how best to resolve this issue.\r\n\r\nThanks.\r\n","author":{"url":"https://github.com/frmichael","@type":"Person","name":"frmichael"},"datePublished":"2020-11-30T10:11:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/526/http-parser/issues/526"}
| 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:4a1dcb33-a2b9-3a32-7bf7-42122743c122 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D9CE:1C9D2:427ED34:5775E27:6992E8BE |
| html-safe-nonce | 32a4b8b40f50a10effc9165ec49591873c45508c6da09acddf9a549c8a4a12b1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOUNFOjFDOUQyOjQyN0VEMzQ6NTc3NUUyNzo2OTkyRThCRSIsInZpc2l0b3JfaWQiOiI1ODMzNzQwOTI0NzE5NjU1MTAyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | dba0953e363f6f6c946af0b55ebe8870ff01826b87bcc6e51eb8cf3bb8d38d60 |
| hovercard-subject-tag | issue:753341893 |
| 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/nodejs/http-parser/526/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f088d3dc6d1dbf1609757950e3c7a1aa253cf5693e320bb692cd1e25ba5d5c67/nodejs/http-parser/issues/526 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f088d3dc6d1dbf1609757950e3c7a1aa253cf5693e320bb692cd1e25ba5d5c67/nodejs/http-parser/issues/526 |
| og:image:alt | Bonjour, Porting http-parser to AIX, where there are 32 and 64 bit environments, there is a test on sizeof (struct http_parser) which fails due to 8 byte reservation for void* on both 32 and 64 bit... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | frmichael |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/http-parser git https://github.com/nodejs/http-parser.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 186749 |
| octolytics-dimension-repository_nwo | nodejs/http-parser |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 186749 |
| octolytics-dimension-repository_network_root_nwo | nodejs/http-parser |
| 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 | 84dcb133269e3cfe6e0296cc85fbacb92cae92bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width