Нашли или выдавили из себя код, который нельзя назвать нормальным,
на который без улыбки не взглянешь?
Не торопитесь его удалять или рефакторить, — запостите его на
говнокод.ру, посмеёмся вместе!
/* how many times the value will be printed?
change 1 line to fix the possibility to compile at diff x64-32 opt lvls
*/
int main(void) {
return ({
#include <stdio.h>;
__attribute__ ((aligned (8))) struct {
struct {
} _struct;
union _union {
int _register_ : 001;
char _auto_ : 1|1;
struct _struct {
double _float;
};
};
int _a;
unsigned short __a;
int ___a;
} letni =
{._a = 0x1122,
0xC1C255AA,
0x334477CC};
*((unsigned short*)&letni._a + (1<<1|1)) = 0x11;
for (volatile int i = *((unsigned short*)&letni.__a); i--;) {
if (i == *((unsigned short*)&letni.__a) - 01) {
*(volatile int*)&i = *((unsigned short*)&letni.___a-1);
continue;
};
printf("%x ", i);
}
}), (0,0);
}
"именно поэтому я за C" (c) j123123
когда -std=c23 -O[0/1/2/3/s/g/fast] смог только штеуд, на прочих -O[0/s]
Почему это говно работает?
PR не принят по причине отсутствия уважения к команде, стр. 24-31 заменить на:
for (volatile int i = *((unsigned short*)&letni.__a),
main = *((unsigned short*)&letni._a + (1<<1|1)) = 0x11; i--;)
(i == *((unsigned short*)&letni.__a) - 01) ?
({*(volatile int*)&i = *((unsigned short*)&letni.___a-1);
continue;})
: 0,
printf("%x ", i);
for (volatile int i = *((unsigned short*)&letni.__a),
main = *((unsigned short*)&letni._a + (1<<1|1)) = 0x11; i--;)
(i == *((unsigned short*)&letni.__a) - 01) ?
({*(volatile int*)&i = *((unsigned short*)&letni.___a-1);
continue;})
: 0,
printf("%x ", i);