Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22461

address-of-packed-member: Disable for specific function?

$
0
0

I've noticed this error raises every time I'm accessing member of packed struct

  1. How can I disable it specifically for functions that handle the misalignment? (safe_unaligned_val_16/32/64 - constructs the output by manually taking byte after byte like memcpy)
  2. Does GCC make some optimization if I pass struct pointers to a function? I've noticed some optimizations like when you have a struct with 4 bytes of primitive types, it just passes that value to a single 32 bit register when the function doesn't change the value of the primitives in. Elaborate if you know anything like this ^

Thanks, Greg


Viewing all articles
Browse latest Browse all 22461

Trending Articles