1. Си / Говнокод #29206

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    /* 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]
    Почему это говно работает?

    Запостил: Raspi_s_Dona, 04 Декабря 2025

    Комментарии (1) RSS

    • 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);
      Ответить

    Добавить комментарий