StackOverflow Questions for Tag: strict-aliasing

user20126994
user20126994

Reputation: 459

In C++, is it valid to treat scalar members of a struct as if they comprised an array?

Score: 43

Views: 4060

Answers: 4

Read More
JAB
JAB

Reputation: 21089

Strict aliasing, CUdeviceptr, and cuMemAllocManaged

Score: 2

Views: 677

Answers: 2

Read More
Evgeny Ilyin
Evgeny Ilyin

Reputation: 141

Does casting a magic address to a pointer in C violate strict aliasing rules?

Score: 4

Views: 161

Answers: 3

Read More
Macushla
Macushla

Reputation: 133

Is it well defined to cast to an identical layout with const members?

Score: 9

Views: 345

Answers: 1

Read More
Konstantin W
Konstantin W

Reputation: 481

GCC optimizing with -Os incorrectly assumes pointer to be NULL

Score: 5

Views: 146

Answers: 1

Read More
Evgeny Ilyin
Evgeny Ilyin

Reputation: 141

Mutual conversion of pointers to a structure and its first member, and strict aliasing in C

Score: 0

Views: 160

Answers: 3

Read More
Oersted
Oersted

Reputation: 2734

is aliasing a plain array to an `std::array` not UB

Score: 0

Views: 176

Answers: 1

Read More
user3624760
user3624760

Reputation:

reinterpret_cast between char* and std::uint8_t* - safe?

Score: 69

Views: 18625

Answers: 3

Read More
Etienne Dechamps
Etienne Dechamps

Reputation: 25351

Strict aliasing of first struct member through opaque pointer in C

Score: 2

Views: 178

Answers: 2

Read More
R.. GitHub STOP HELPING ICE
R.. GitHub STOP HELPING ICE

Reputation: 215507

Is unsigned char a[4][5]; a[1][7]; undefined behavior?

Score: 9

Views: 822

Answers: 6

Read More
blonded04
blonded04

Reputation: 503

CAS'ing 32 lower bits of the 64 bit word in C++

Score: 0

Views: 135

Answers: 2

Read More
maxschlepzig
maxschlepzig

Reputation: 39195

Aliasing accesses through a std::bit_cast()ed pointer

Score: 3

Views: 2040

Answers: 1

Read More
Lundin
Lundin

Reputation: 214770

gcc -O3 diagnostic warning: '<U ea0>' is used uninitialized - UB, bug or "name mangling"?

Score: 4

Views: 107

Answers: 1

Read More
PavelDev
PavelDev

Reputation: 683

How to convert a byte array to a type without UB?

Score: 0

Views: 143

Answers: 0

Read More
R.. GitHub STOP HELPING ICE
R.. GitHub STOP HELPING ICE

Reputation: 215507

Understanding restrict qualifier by examples

Score: 17

Views: 3293

Answers: 2

Read More
jacobsa
jacobsa

Reputation: 6638

In C++ can you use one empty type as storage for another?

Score: 4

Views: 171

Answers: 1

Read More
bakaq
bakaq

Reputation: 53

How to workaround strict aliasing in C?

Score: 3

Views: 446

Answers: 2

Read More
guitarflow
guitarflow

Reputation: 2970

Why does optimisation kill this function?

Score: 50

Views: 5778

Answers: 3

Read More
Benoit
Benoit

Reputation: 39094

What is the strict aliasing rule?

Score: 1015

Views: 317424

Answers: 11

Read More
ReotardoDaVinci
ReotardoDaVinci

Reputation: 57

Is accessing a struct within a struct by pointers undefined behavior?

Score: 3

Views: 205

Answers: 3

Read More
PreviousPage 2Next