Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about bit-fields

Read more about bit-fields

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - bit-fields

C++ bit field member variable initialization value (UE4 example)

I'm wondering what value a bit-field class member variable will have if it is not explicitly initialized. Using an example from unreal engine 4.27: //member variable of UPrimitiveComponent //there are...
test-img

badger5000

c++

initialization

unreal-engine4

bit-fields

Votes: 0

Answers: 1

Latest Answer

Dug a little bit deeper, so I'll try to answer this myself. I believe that for a normal C++ class it would be undefined behaviour as I cannot find any info suggesting otherwise for bit-fields specific...
test-img

badger5000

Avoid volatile bit-field assignment expression reading or writing memory several times

I want to use volatile bit-field struct to set hardware register like following code union foo { uint32_t value; struct { uint32_t x : 1; uint32_t y : 3; uint32_t z : 2...
test-img

old cat

c

assembly

embedded

volatile

bit-fields

Votes: 0

Answers: 3

Latest Answer

I think this is a bug in GCC. Per discussion below, you might consider using: f_ptr->value = (union foo) { .x = 1, .y = 7, .z = 10, } .value; By the C standard, the co...
test-img

Eric Postpischil

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved