Const register volatile unsigned int b asm("eax") = *(int*)(&a - sizeof(a));

const register volatile unsigned int b asm("eax") = *(int*)(&a - sizeof(a));

Attached: froge.jpg (976x850, 57.91K)

ur gay fuk u faget

Great thread.

auto b = *(&a - 4);
fixed

>let me just add keywords that don't do anything for no reason other than to make this line longer
>look how long this line is!
cool

>that don't do anything
retard

All modern compilers ignore the register keyword

No they don't

There are some poorly maintained old compilers that will allow you to use it exclusively to either hamper performance or do nothing, but the commonly used compilers will ignore it in C, and all compilers will ignore it in C++ (by spec)

On my version of GCC, the register keyword is used when no optimizations are being used. I'm guessing later versions do similar instead of outright ignoring it

>GCC
I explicitly excluded "poorly maintained old compilers"

Attached: Screen Shot 2022-02-02 at 3.21.17 PM.png (1280x719, 140.72K)

lol

>the register keyword is used when no optimizations are being used
The only thing gcc uses it for is the 'asm("eax")' bit. If you don't include that then the register hint doesn't do anything.

Okay, am I the only retard in this thread? What does this code do?

> *(int*)(&a - sizeof(a))
Value of the integer that is defined just after a? (or just before a?)
> const register volatile unsigned int b asm("eax")
Yo wtf

> const register volatile unsigned int b asm("eax")
doesn't do anything important, basically just
unsigned int b

>Value of the integer that is defined just after a? (or just before a?)
close

I tried to compile this and gcc produced this video file...

pointer to an integer pointer, address of a minus the bytes of a

>register volatile
The "register" keyword is a suggestion to the compiler that a variable should be stored in a CPU register, rather than in memory. The entire point of volatile variables, however, is that we assume that this is a location in memory, which may provide inconsistent values between reads (i.e. an I/O register). These two properties contradict each other.

it's incredible that he never realised the 4 freedoms are to
Execute (the code, HoW You LIkE)
Read (the source)
Write (the source, aka a copy)
Write (modified source, which only courts see as a different permission to writing the source due to homosexual patent law)

aren't you assuming a's type?

you can do that in C but not in nufag langauges like Rust