Title: Is it correct to cast any char* pointer to another type? · Issue #6 · CPythoner/ByteBuffer · GitHub
Open Graph Title: Is it correct to cast any char* pointer to another type? · Issue #6 · CPythoner/ByteBuffer
X Title: Is it correct to cast any char* pointer to another type? · Issue #6 · CPythoner/ByteBuffer
Description: template
Open Graph Description: template
X Description: template
Opengraph URL: https://github.com/CPythoner/ByteBuffer/issues/6
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Is it correct to cast any char* pointer to another type?","articleBody":"```cpp\r\n template \u003ctypename T\u003e\r\n T read(uint32_t index) const\r\n {\r\n if (!p_buffer_ || index + sizeof(T) \u003e limit_)\r\n return 0;\r\n\r\n return *((T*)\u0026p_buffer_[index]);\r\n }\r\n```\r\n i think this is undefined behavior.\r\n\r\n\r\n\r\n\r\n\r\n\r\n","author":{"url":"https://github.com/sxstd001","@type":"Person","name":"sxstd001"},"datePublished":"2024-03-09T10:51:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/6/ByteBuffer/issues/6"}
| 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:9c46dcb2-1da1-abc7-3532-f234ef7b9867 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8048:313B07:1B7DA6:254370:6A5B5A1B |
| html-safe-nonce | 97916f34e22b00b802980acb15b112633b205c45221c8eb50001ad4f05dc714c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDQ4OjMxM0IwNzoxQjdEQTY6MjU0MzcwOjZBNUI1QTFCIiwidmlzaXRvcl9pZCI6IjMzMDE2NzA4NDI1OTg2NDQyNTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8430710e81dd28264c331fbbdc0b79ae59629c16a11a3b287ca14794d412c87e |
| hovercard-subject-tag | issue:2177178415 |
| 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/CPythoner/ByteBuffer/6/issue_layout |
| twitter:image | https://opengraph.githubassets.com/82edd79df39012a23249f71a6132b53c2962bf7b7ef5784231a8a4a9f2ab3c37/CPythoner/ByteBuffer/issues/6 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/82edd79df39012a23249f71a6132b53c2962bf7b7ef5784231a8a4a9f2ab3c37/CPythoner/ByteBuffer/issues/6 |
| og:image:alt | template |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sxstd001 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/CPythoner/ByteBuffer git https://github.com/CPythoner/ByteBuffer.git |
| octolytics-dimension-user_id | 6645605 |
| octolytics-dimension-user_login | CPythoner |
| octolytics-dimension-repository_id | 351674544 |
| octolytics-dimension-repository_nwo | CPythoner/ByteBuffer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 351674544 |
| octolytics-dimension-repository_network_root_nwo | CPythoner/ByteBuffer |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width