StackOverflow Questions for Tag: pointer-conversion

user2138149
user2138149

Reputation: 17266

What is the correct type of cast to use for non-typesafe pointer conversions for binary data reinterpret operations?

Score: 1

Views: 159

Answers: 3

Read More
Joseph Garvin
Joseph Garvin

Reputation: 21974

Is it possible to have a 32-bit pointer on x86-64 without undefined behavior?

Score: 5

Views: 258

Answers: 3

Read More
greenlagoon
greenlagoon

Reputation: 121

Interpreting part of an array as an object by casting a pointer to an array element

Score: 3

Views: 183

Answers: 2

Read More
timmy george
timmy george

Reputation: 447

Is casting `the address of a pointer to a struct` to `the address of a struct whos first member is a pointer to the struct` UB?

Score: 4

Views: 71

Answers: 1

Read More
Max Kielland
Max Kielland

Reputation: 5841

How to assign a reader to TFDBatchMove::Reader in runtime?

Score: 1

Views: 70

Answers: 0

Read More
John Hoffman
John Hoffman

Reputation: 15

Procedurally bind struct fields to command line flag values using reflect

Score: 0

Views: 845

Answers: 1

Read More
fschwaiger
fschwaiger

Reputation: 359

MISRA C:2012 11.3 violation casting (float *) to (uint32_t *)

Score: 2

Views: 328

Answers: 2

Read More
digito_evo
digito_evo

Reputation: 3682

In what cases does the standard forbid taking pointers to functions/objects?

Score: -2

Views: 136

Answers: 1

Read More
ravi
ravi

Reputation: 3424

Can't pass non-const T* to a function accepting reference to const T*

Score: 20

Views: 17192

Answers: 1

Read More
user20562802
user20562802

Reputation:

void* ptr = &func; compiles with msvc without any diagnostic but both gcc and clang rejects it

Score: 4

Views: 230

Answers: 1

Read More
Lundin
Lundin

Reputation: 214770

Why doesn't gcc 13 display the correct binary represenation?

Score: 7

Views: 220

Answers: 1

Read More
Blackbriar07
Blackbriar07

Reputation: 3

MISRA C:2012 Rule 11.3 A cast shall not be performed between a pointer to object type and a pointer to a different object type

Score: 0

Views: 767

Answers: 1

Read More
Alan
Alan

Reputation: 1

Do all pointers have the same size in C++?

Score: 58

Views: 10072

Answers: 10

Read More
user18676624
user18676624

Reputation: 95

Is casting to (void**) well-defined?

Score: 7

Views: 232

Answers: 1

Read More
Alex Guteniev
Alex Guteniev

Reputation: 13719

Should static_pointer_cast calls be std:: qualified, or relied upon ADL?

Score: 0

Views: 272

Answers: 1

Read More
editsons
editsons

Reputation: 97

C++ Socket recv() always returns 0

Score: 0

Views: 137

Answers: 1

Read More
sparsh goyal
sparsh goyal

Reputation: 131

does implicit pointer conversion occur during assignment?

Score: 0

Views: 63

Answers: 1

Read More
Alex
Alex

Reputation: 1175

Proper handling of 128..255 chars in C

Score: 0

Views: 182

Answers: 1

Read More
thedoctar
thedoctar

Reputation: 9094

Bug casting from bool* to void* to int*

Score: 0

Views: 398

Answers: 1

Read More
ahk
ahk

Reputation: 43

Might casting void* into unsigned long int cause undefined behaviour even where sizeof(void*)==sizeof(unsigned long int)

Score: 3

Views: 719

Answers: 3

Read More
PreviousPage 1Next