免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: walleeee
打印 上一主题 下一主题

不知道大家看了这个是什么心里滋味 [复制链接]

论坛徽章:
0
121 [报告]
发表于 2012-04-28 01:13 |只看该作者
回复 116# OwnWaterloo


你觉得你说的问题少字数少,我就该用一样少的字回答?那你说1本道德经,5000字,但是答里面的问题,用了多少字?是不是那些多余5000的字都是垃圾。另外,你的c标准多少字?是不是别人讲c的书,超过这个字数也都是垃圾?
我是怕你又来扯,因为你阅读障碍,所以给你说明白点。算了,里外不是人的事情我也懒得做了。

我不是标准狂,我也没有考据癖,我一天要读那么多东西,要看那么多材料,我怎么记得在哪里看过?我没有你跟你一样用大脑换硬盘,所以比硬盘,这个不是我的长项,你以为我会上当么?用我之短,比你之长?

随意吧,你这种货色,我还是头一次见到,你的确是厉害

论坛徽章:
0
122 [报告]
发表于 2012-04-28 01:18 |只看该作者
回复 118# sacry


嗯,我看到了,的确这里会发生提升,这里去掉“这是编译器实现相关”

论坛徽章:
0
123 [报告]
发表于 2012-04-28 01:23 |只看该作者
回复 120# OwnWaterloo


你不要混淆问题,一会这样,一会那样。

1) 他就被当作牛了 2) 他就可以理直气壮的开喷了 3) 最后还让读者认为自己错了,并产生了阅读障碍。 4) 总之他就是神,他就是规则

1.我最多笑一下,有什么好处?
2.我没喷,确定的事情,我就没什么好说的
3.我没觉得他没看懂,我倒是觉得他看的比你明白,至少基本懂了我要说的目的。并指出规范说char+char这个标准定义的提升到int,然后我之前觉得这个和编译器相关,然后我查了标准,的确有是必然发生提升,所以我就修改了之前的说了。你觉得这是什么?跟你一样瞎扯和攻击?你这种货色,真不知道说你什么好。
4.我就算是神,就算是规则,和你半毛钱关系?何况我从来没这种习惯,倒是你,你难道不觉得是在说你自己?真是笑话。

有人撕他的脸,他就开始跳了

是你一直跟我瞎扯,我只是在不停的应对你瞎扯,你居然说我主动,我都不知道该什么什么好了,老话,你这二货,我算是看明白了。

论坛徽章:
2
青铜圣斗士
日期:2015-11-26 06:15:59数据库技术版块每日发帖之星
日期:2016-07-24 06:20:00
124 [报告]
发表于 2012-04-28 01:44 |只看该作者
回复 118# sacry

我只列关键的,更详细的你去看原文吧。


------ C89 ------
i) 6.3.6 Additive operators
If both operands have arithmetic type, the usual arithmetic conversions are performed on them.

char+char符合两个操作数都是arithmetic type,执行usual arithmetic conversions。


ii) 6.2.1.5 Usual arithmetic conversions
Many binary operators that expect operands of arithmetic type cause
conversions and yield result types in a similar way. The purpose is
to yield a common type, which is also the type of the result.

usual arithmetic conversion选择一个common type —— C被说成是弱类型的缘由之一 —— 作为操作数与结果的类型。

Otherwise, the integral promotions are performed on both operands.
Then the following rules are applied:
...
Otherwise, both operands have type int.

第1个Otherwise之前是针对有一个操作数是long double/double/float的情况。
Then 之后的又有一长串是针对有一个操作数是unsigned long,long,unsigned int说的。


iii) 6.2.1.1 Characters and integers
integral promotion:
A char, a short int, or an int bit-field, or their signed or
unsigned varieties, or an object that has enumeration type, may be
used in an expression wherever an int or unsigned int may be used. If
an int can represent all values of the original type, the value is
converted to an int; otherwise it is converted to an unsigned int.
These are called the integral promotions.




------ C99 ------

i) 6.5.6 Additive operators
4 If both operands have arithmetic type, the usual arithmetic conversions are performed on them.


ii) 6.3.1.8 Usual arithmetic conversions
Otherwise, the integer promotions are performed on both operands. Then the following rules are applied to the promoted operands:

Otherwise之前同样是说浮点。具体规则与C89不同,因为C99有个rank。

iii) 6.3.1.1 Boolean, characters, and integers
2 The following may be used in an expression wherever an int or unsigned int may be used:
— An object or expression with an integer type whose integer conversion rank is less
than the rank of int and unsigned int.
...
If an int can represent all values of the original type, the value is converted to an int;
otherwise, it is converted to an unsigned int.
These are called the integer promotions.4 All other types are unchanged by the integer promotions.

char的rank比int低。



------ 最后再来野路子 ------

我在75楼贴的代码,这里再重复贴一次:

  1. #include <limits.h>
  2. #include <string.h>
  3. #include <stdio.h>

  4. int main(int argc, char* argv[])
  5. {
  6.       printf("[%d,%d]\n", CHAR_MIN, CHAR_MAX);
  7.       if (argc>1 && strlen(argv[1])>=2)
  8.       {
  9.             char* p = argv[1];
  10.             printf("%d + %d\n", p[0], p[1]);
  11.             printf("%d\n", p[0]+p[1]);
  12.             return 0;
  13.       }
  14.       return -1;
  15. }
复制代码
3种编译器,6种参数组合产生的汇编代码 —— 先列关键处,详细的附在后面供检阅。

  • cl -W3 -O2 -FAs

    1. ; 12   :             printf("%d\n", p[0]+p[1]);

    2.         movsx        eax, BYTE PTR [esi]     ; 提升
    3.         movsx        ecx, BYTE PTR [esi+1]   ; 提升
    4.         add        eax, ecx                ; int + int
    5.         push        eax
    6.         push        OFFSET ??_C@_03PMGGPEJJ@?$CFd?6?$AA@
    7.         call        _printf
    复制代码
  • cl -W3 -O2 -J -FAs
    ; 12   :             printf("%d\n", p[0]+p[1]);

            movzx        eax, BYTE PTR [esi]     ; 提升,符号扩展方式不同
            movzx        ecx, BYTE PTR [esi+1]
            add        eax, ecx                ; int + int
            push        eax
            push        OFFSET ??_C@_03PMGGPEJJ@?$CFd?6?$AA@
            call        _printf
    [/code]
  • gcc -Wall -O2 -S -o -

    1. LC2:
    2.         .ascii "%d\12\0"        ; 最后一个printf所用的literal

    3.         call        _printf         ; 中间那个printf
    4.         movsbl        (%ebx),%eax     ; 提升
    5.         movsbl        1(%ebx),%edx    ; 提升
    6.         movl        $LC2, (%esp)    ; 传入 "%d\n"
    7.         addl        %edx, %eax      ; int + int
    8.         movl        %eax, 4(%esp)   ; 传入和
    9.         call        _printf         ; 最后一个printf调用
    复制代码
  • gcc -Wall -O2 -S -funsigned-char -o -

    1. LC2:
    2.         .ascii "%d\12\0"

    3.         call        _printf
    4.         movzbl        (%ebx), %eax    ; 其他同上,只有符号扩展方式不同
    5.         movzbl        1(%ebx), %edx
    6.         movl        $LC2, (%esp)
    7.         addl        %edx, %eax
    8.         movl        %eax, 4(%esp)
    9.         call        _printf
    复制代码
  • clang -Wall -O2 -S -o -

    1. L_.str2:                                # @.str2
    2.         .asciz         "%d\n"         ; 最后一个printf所用的literal

    3.         calll        _printf         ; 中间那个printf
    4.         movsbl        (%esi), %eax    ; 提升
    5.         movsbl        1(%esi), %ecx   ; 提升
    6.         addl        %eax, %ecx      ; int + int
    7.         movl        %ecx, 4(%esp)   ; 传入和
    8.         movl        $L_.str2, (%esp); 传入 "%d\n"
    9.         calll        _printf         ; 最后一个printf调用
    复制代码
  • clang -Wall -O2 -funsigned-char -S -o -
    L_.str2:                                # @.str2
            .asciz         "%d\n"

            calll        _printf
            movzbl        (%esi), %eax    ; 其他同上,只有符号扩展方式不同
            movzbl        1(%esi), %ecx
            addl        %eax, %ecx
            movl        %ecx, 4(%esp)
            movl        $L_.str2, (%esp)
            calll        _printf



详细代码:
  • cl -W3 -O2 -FAs

    1. CONST        SEGMENT
    2. ??_C@_03PMGGPEJJ@?$CFd?6?$AA@ DB '%d', 0aH, 00H                ; `string'
    3. CONST        ENDS
    4. ;        COMDAT ??_C@_08MEPLLFOL@?$CFd?5?$CL?5?$CFd?6?$AA@
    5. CONST        SEGMENT
    6. ??_C@_08MEPLLFOL@?$CFd?5?$CL?5?$CFd?6?$AA@ DB '%d + %d', 0aH, 00H ; `string'
    7. CONST        ENDS
    8. ;        COMDAT ??_C@_08HEBOGADK@?$FL?$CFd?0?$CFd?$FN?6?$AA@
    9. CONST        SEGMENT
    10. ??_C@_08HEBOGADK@?$FL?$CFd?0?$CFd?$FN?6?$AA@ DB '[%d,%d]', 0aH, 00H ; `string'
    11. ; Function compile flags: /Ogtpy
    12. CONST        ENDS
    13. ;        COMDAT _main
    14. _TEXT        SEGMENT
    15. _argc$ = 8                                                ; size = 4
    16. _argv$ = 12                                                ; size = 4
    17. _main        PROC                                                ; COMDAT

    18. ; 6    : {

    19.         push        esi

    20. ; 7    :       printf("[%d,%d]\n", CHAR_MIN, CHAR_MAX);

    21.         push        127                                        ; 0000007fH
    22.         push        -128                                        ; ffffff80H
    23.         push        OFFSET ??_C@_08HEBOGADK@?$FL?$CFd?0?$CFd?$FN?6?$AA@
    24.         call        _printf
    25.         add        esp, 12                                        ; 0000000cH

    26. ; 8    :       if (argc>1 && strlen(argv[1])>=2)

    27.         cmp        DWORD PTR _argc$[esp], 1
    28.         jle        SHORT $LN1@main
    29.         mov        eax, DWORD PTR _argv$[esp]
    30.         mov        esi, DWORD PTR [eax+4]
    31.         mov        eax, esi
    32.         lea        edx, DWORD PTR [eax+1]
    33. $LL4@main:
    34.         mov        cl, BYTE PTR [eax]
    35.         add        eax, 1
    36.         test        cl, cl
    37.         jne        SHORT $LL4@main
    38.         sub        eax, edx
    39.         cmp        eax, 2
    40.         jb        SHORT $LN1@main

    41. ; 9    :       {
    42. ; 10   :             char* p = argv[1];
    43. ; 11   :             printf("%d + %d\n", p[0], p[1]);

    44.         movsx        ecx, BYTE PTR [esi+1]
    45.         movsx        edx, BYTE PTR [esi]
    46.         push        ecx
    47.         push        edx
    48.         push        OFFSET ??_C@_08MEPLLFOL@?$CFd?5?$CL?5?$CFd?6?$AA@
    49.         call        _printf

    50. ; 12   :             printf("%d\n", p[0]+p[1]);

    51.         movsx        eax, BYTE PTR [esi]
    52.         movsx        ecx, BYTE PTR [esi+1]
    53.         add        eax, ecx
    54.         push        eax
    55.         push        OFFSET ??_C@_03PMGGPEJJ@?$CFd?6?$AA@
    56.         call        _printf
    57.         add        esp, 20                                        ; 00000014H

    58. ; 13   :             return 0;

    59.         xor        eax, eax
    60.         pop        esi

    61. ; 16   : }

    62.         ret        0
    63. $LN1@main:

    64. ; 14   :       }
    65. ; 15   :       return -1;

    66.         or        eax, -1
    67.         pop        esi

    68. ; 16   : }

    69.         ret        0
    70. _main        ENDP
    71. _TEXT        ENDS
    72. END
    复制代码
  • cl -W3 -O2 -J -FAs

    1. CONST        SEGMENT
    2. ??_C@_03PMGGPEJJ@?$CFd?6?$AA@ DB '%d', 0aH, 00H                ; `string'
    3. CONST        ENDS
    4. ;        COMDAT ??_C@_08MEPLLFOL@?$CFd?5?$CL?5?$CFd?6?$AA@
    5. CONST        SEGMENT
    6. ??_C@_08MEPLLFOL@?$CFd?5?$CL?5?$CFd?6?$AA@ DB '%d + %d', 0aH, 00H ; `string'
    7. CONST        ENDS
    8. ;        COMDAT ??_C@_08HEBOGADK@?$FL?$CFd?0?$CFd?$FN?6?$AA@
    9. CONST        SEGMENT
    10. ??_C@_08HEBOGADK@?$FL?$CFd?0?$CFd?$FN?6?$AA@ DB '[%d,%d]', 0aH, 00H ; `string'
    11. ; Function compile flags: /Ogtpy
    12. CONST        ENDS
    13. ;        COMDAT _main
    14. _TEXT        SEGMENT
    15. _argc$ = 8                                                ; size = 4
    16. _argv$ = 12                                                ; size = 4
    17. _main        PROC                                                ; COMDAT

    18. ; 6    : {

    19.         push        esi

    20. ; 7    :       printf("[%d,%d]\n", CHAR_MIN, CHAR_MAX);

    21.         push        255                                        ; 000000ffH
    22.         push        0
    23.         push        OFFSET ??_C@_08HEBOGADK@?$FL?$CFd?0?$CFd?$FN?6?$AA@
    24.         call        _printf
    25.         add        esp, 12                                        ; 0000000cH

    26. ; 8    :       if (argc>1 && strlen(argv[1])>=2)

    27.         cmp        DWORD PTR _argc$[esp], 1
    28.         jle        SHORT $LN1@main
    29.         mov        eax, DWORD PTR _argv$[esp]
    30.         mov        esi, DWORD PTR [eax+4]
    31.         mov        eax, esi
    32.         lea        edx, DWORD PTR [eax+1]
    33. $LL4@main:
    34.         mov        cl, BYTE PTR [eax]
    35.         add        eax, 1
    36.         test        cl, cl
    37.         jne        SHORT $LL4@main
    38.         sub        eax, edx
    39.         cmp        eax, 2
    40.         jb        SHORT $LN1@main

    41. ; 9    :       {
    42. ; 10   :             char* p = argv[1];
    43. ; 11   :             printf("%d + %d\n", p[0], p[1]);

    44.         movzx        ecx, BYTE PTR [esi+1]
    45.         movzx        edx, BYTE PTR [esi]
    46.         push        ecx
    47.         push        edx
    48.         push        OFFSET ??_C@_08MEPLLFOL@?$CFd?5?$CL?5?$CFd?6?$AA@
    49.         call        _printf

    50. ; 12   :             printf("%d\n", p[0]+p[1]);

    51.         movzx        eax, BYTE PTR [esi]
    52.         movzx        ecx, BYTE PTR [esi+1]
    53.         add        eax, ecx
    54.         push        eax
    55.         push        OFFSET ??_C@_03PMGGPEJJ@?$CFd?6?$AA@
    56.         call        _printf
    57.         add        esp, 20                                        ; 00000014H

    58. ; 13   :             return 0;

    59.         xor        eax, eax
    60.         pop        esi

    61. ; 16   : }

    62.         ret        0
    63. $LN1@main:

    64. ; 14   :       }
    65. ; 15   :       return -1;

    66.         or        eax, -1
    67.         pop        esi

    68. ; 16   : }

    69.         ret        0
    70. _main        ENDP
    71. _TEXT        ENDS
    72. END
    复制代码
  • gcc -Wall -O2 -S -o -

    1.         .section .rdata,"dr"
    2. LC0:
    3.         .ascii "[%d,%d]\12\0"
    4. LC1:
    5.         .ascii "%d + %d\12\0"
    6. LC2:
    7.         .ascii "%d\12\0"
    8.         .text
    9.         .p2align 4,,15
    10. .globl _main
    11.         .def        _main;        .scl        2;        .type        32;        .endef
    12. _main:
    13.         pushl        %ebp
    14.         movl        $16, %eax
    15.         movl        %esp, %ebp
    16.         pushl        %ebx
    17.         subl        $20, %esp
    18.         andl        $-16, %esp
    19.         call        __alloca
    20.         call        ___main
    21.         movl        $LC0, (%esp)
    22.         movl        $127, %edx
    23.         movl        $-128, %eax
    24.         movl        %edx, 8(%esp)
    25.         movl        %eax, 4(%esp)
    26.         call        _printf
    27.         cmpl        $1, 8(%ebp)
    28.         jle        L2
    29.         movl        12(%ebp), %eax
    30.         movl        4(%eax), %ebx
    31.         movl        %ebx, (%esp)
    32.         call        _strlen
    33.         cmpl        $1, %eax
    34.         ja        L4
    35. L2:
    36.         movl        -4(%ebp), %ebx
    37.         movl        $-1, %eax
    38.         leave
    39.         ret
    40.         .p2align 4,,7
    41. L4:
    42.         movsbl        1(%ebx),%eax
    43.         movl        %eax, 8(%esp)
    44.         movsbl        (%ebx),%eax
    45.         movl        $LC1, (%esp)
    46.         movl        %eax, 4(%esp)
    47.         call        _printf
    48.         movsbl        (%ebx),%eax
    49.         movsbl        1(%ebx),%edx
    50.         movl        $LC2, (%esp)
    51.         addl        %edx, %eax
    52.         movl        %eax, 4(%esp)
    53.         call        _printf
    54.         movl        -4(%ebp), %ebx
    55.         xorl        %eax, %eax
    56.         leave
    57.         ret
    58.         .def        _strlen;        .scl        2;        .type        32;        .endef
    59.         .def        _printf;        .scl        2;        .type        32;        .endef
    复制代码
  • gcc -Wall -O2 -S -funsigned-char -o -

    1. LC0:
    2.         .ascii "[%d,%d]\12\0"
    3. LC1:
    4.         .ascii "%d + %d\12\0"
    5. LC2:
    6.         .ascii "%d\12\0"
    7.         .text
    8.         .p2align 4,,15
    9. .globl _main
    10.         .def        _main;        .scl        2;        .type        32;        .endef
    11. _main:
    12.         pushl        %ebp
    13.         movl        $16, %eax
    14.         movl        %esp, %ebp
    15.         pushl        %ebx
    16.         subl        $20, %esp
    17.         andl        $-16, %esp
    18.         call        __alloca
    19.         call        ___main
    20.         movl        $LC0, (%esp)
    21.         xorl        %eax, %eax
    22.         movl        $255, %edx
    23.         movl        %edx, 8(%esp)
    24.         movl        %eax, 4(%esp)
    25.         call        _printf
    26.         cmpl        $1, 8(%ebp)
    27.         jle        L2
    28.         movl        12(%ebp), %eax
    29.         movl        4(%eax), %ebx
    30.         movl        %ebx, (%esp)
    31.         call        _strlen
    32.         cmpl        $1, %eax
    33.         ja        L4
    34. L2:
    35.         movl        -4(%ebp), %ebx
    36.         movl        $-1, %eax
    37.         leave
    38.         ret
    39.         .p2align 4,,7
    40. L4:
    41.         movzbl        1(%ebx), %eax
    42.         movl        %eax, 8(%esp)
    43.         movzbl        (%ebx), %eax
    44.         movl        $LC1, (%esp)
    45.         movl        %eax, 4(%esp)
    46.         call        _printf
    47.         movzbl        (%ebx), %eax
    48.         movzbl        1(%ebx), %edx
    49.         movl        $LC2, (%esp)
    50.         addl        %edx, %eax
    51.         movl        %eax, 4(%esp)
    52.         call        _printf
    53.         movl        -4(%ebp), %ebx
    54.         xorl        %eax, %eax
    55.         leave
    56.         ret
    57.         .def        _strlen;        .scl        2;        .type        32;        .endef
    58.         .def        _printf;        .scl        2;        .type        32;        .endef
    复制代码
  • clang -Wall -O2 -S -o -

    1. _main:                                  # @main
    2. # BB#0:
    3.         pushl        %ebp
    4.         movl        %esp, %ebp
    5.         pushl        %esi
    6.         subl        $12, %esp
    7.         movl        $127, 8(%esp)
    8.         movl        $-128, 4(%esp)
    9.         movl        $L_.str, (%esp)
    10.         calll        _printf
    11.         cmpl        $2, 8(%ebp)
    12.         jl        LBB0_3
    13. # BB#1:
    14.         movl        12(%ebp), %eax
    15.         movl        4(%eax), %esi
    16.         movl        %esi, (%esp)
    17.         calll        _strlen
    18.         cmpl        $2, %eax
    19.         jb        LBB0_3
    20. # BB#2:
    21.         movsbl        (%esi), %eax
    22.         movsbl        1(%esi), %ecx
    23.         movl        %ecx, 8(%esp)
    24.         movl        %eax, 4(%esp)
    25.         movl        $L_.str1, (%esp)
    26.         calll        _printf
    27.         movsbl        (%esi), %eax
    28.         movsbl        1(%esi), %ecx
    29.         addl        %eax, %ecx
    30.         movl        %ecx, 4(%esp)
    31.         movl        $L_.str2, (%esp)
    32.         calll        _printf
    33.         xorl        %eax, %eax
    34.         jmp        LBB0_4
    35. LBB0_3:
    36.         movl        $-1, %eax
    37. LBB0_4:
    38.         addl        $12, %esp
    39.         popl        %esi
    40.         popl        %ebp
    41.         ret

    42.         .data
    43. L_.str:                                 # @.str
    44.         .asciz         "[%d,%d]\n"

    45. L_.str1:                                # @.str1
    46.         .asciz         "%d + %d\n"

    47. L_.str2:                                # @.str2
    48.         .asciz         "%d\n"
    复制代码
  • clang -Wall -O2 -funsigned-char -S -o -

    1. _main:                                  # @main
    2. # BB#0:
    3.         pushl        %ebp
    4.         movl        %esp, %ebp
    5.         pushl        %esi
    6.         subl        $12, %esp
    7.         movl        $255, 8(%esp)
    8.         movl        $0, 4(%esp)
    9.         movl        $L_.str, (%esp)
    10.         calll        _printf
    11.         cmpl        $2, 8(%ebp)
    12.         jl        LBB0_3
    13. # BB#1:
    14.         movl        12(%ebp), %eax
    15.         movl        4(%eax), %esi
    16.         movl        %esi, (%esp)
    17.         calll        _strlen
    18.         cmpl        $2, %eax
    19.         jb        LBB0_3
    20. # BB#2:
    21.         movzbl        (%esi), %eax
    22.         movzbl        1(%esi), %ecx
    23.         movl        %ecx, 8(%esp)
    24.         movl        %eax, 4(%esp)
    25.         movl        $L_.str1, (%esp)
    26.         calll        _printf
    27.         movzbl        (%esi), %eax
    28.         movzbl        1(%esi), %ecx
    29.         addl        %eax, %ecx
    30.         movl        %ecx, 4(%esp)
    31.         movl        $L_.str2, (%esp)
    32.         calll        _printf
    33.         xorl        %eax, %eax
    34.         jmp        LBB0_4
    35. LBB0_3:
    36.         movl        $-1, %eax
    37. LBB0_4:
    38.         addl        $12, %esp
    39.         popl        %esi
    40.         popl        %ebp
    41.         ret

    42.         .data
    43. L_.str:                                 # @.str
    44.         .asciz         "[%d,%d]\n"

    45. L_.str1:                                # @.str1
    46.         .asciz         "%d + %d\n"

    47. L_.str2:                                # @.str2
    48.         .asciz         "%d\n"
    复制代码

论坛徽章:
2
青铜圣斗士
日期:2015-11-26 06:15:59数据库技术版块每日发帖之星
日期:2016-07-24 06:20:00
125 [报告]
发表于 2012-04-28 01:52 |只看该作者
walleeee 发表于 2012-04-27 21:04
回复 77# OwnWaterloo

你能不要搞这么多垃圾么?你是不是把我当成你一样有阅读障碍?我看得懂,不用你在这里玩花痴


你这是针对我75-77改格式回复的。

如果我在75原地修改,又被你这不修改帖子的人抓到口实了。所以我没在原地修改。
如果我没在76-77附加,你还是可以找到理由说我帖垃圾

针对我在75-77修改格式的方式,你怎么都能找到理由攻击我

论坛徽章:
2
青铜圣斗士
日期:2015-11-26 06:15:59数据库技术版块每日发帖之星
日期:2016-07-24 06:20:00
126 [报告]
发表于 2012-04-28 02:02 |只看该作者
walleeee 发表于 2012-04-28 00:01
回复 95# OwnWaterloo

你看不懂么?我也不想再说一遍你阅读障碍,而且比较严重,只能读懂那些表意非常明确的陈述表达。
我这里的意思是你指出的问题是存在的,你之前的实例代码也正是凸显了这些问题。然后,我再说我并不觉得这些是正常该做的事情。为什么我这么说,因为char+char被溢出是不符合常规逻辑的,255+255,你想要什么?正常人当然是要510。编译器做的事情,正好就符合这个常识,而你却把这些当成攻击别人,自以为是的奇技淫巧。然后,我顺带说了(为了顺着你的路子和那颗奇技淫巧的邪恶内心)一般文本字符就是一个int。最后,我表达了一个反问,目的是让你真正能看懂,或者说理解我说的意思,因为我一直觉得你阅读障碍,果不其然,尽管我做了这个事情,你依然还是阅读障碍,看不懂,瞎猜,我没法了。
你倒打一耙说我逻辑混乱,唉,好吧,我真没法了



1. 我用这种自以为是的奇技淫巧攻击别人?

从我给gvim指出char+char也会提升开始,然后:
walleeee 发表于 2012-04-27 15:15
回复 69# OwnWaterloo

别放屁,说话跟放屁一样随意,你试过么?
我为什么试了几个编译器,就你没你说的Char+char会提升?你别放屁了


按你的说法,我这不是在反击,而是在攻击你? 嘿嘿嘿嘿。


2. 我阅读障碍还是你逻辑混乱

2.1 p[0] + p[1] 与 character literal屁关系没有
2.2 你的推理从一开始就是狗屁,自然最终得到的也是狗屁
>> 255+255,你想要什么?正常人当然是要510。
是p[0] + p[1], p是char*类型, 与255+255 有屁联系

2.3 为什么我这么说,因为char+char被溢出是不符合常规逻辑的,255+255,你想要什么?正常人当然是要510。编译器做的事情,正好就符合这个常识

按照你的逻辑: int+int被溢出也是不符合常规逻辑的, INT_MAX+INT_MAX,你想要什么? 正常人当然是要INT_MAX*2。
编译器做的事情, 怎么就没符合你所谓的这个常识了呢?

论坛徽章:
0
127 [报告]
发表于 2012-04-28 02:05 |只看该作者
回复 125# OwnWaterloo


出了我这一次,我什么时候有争对过你帖子格式,或者某个错别字,或者少打了某个字而发表过任何批评?

我在尽力的理解你说的话,包括有些明显的遗漏,我都懒得提了。

最后,我说这个也并非批评,不过是提醒你我并不在意这个格式,你又要说成是我
“针对我在75-77修改格式的方式,你怎么都能找到理由攻击我。”
你真是阅读障碍,理解能力低级。

算了,我不想就这个问题继续扯,我不跟你这种二货一样黑白颠倒,我不想早死,我要睡觉了,你随意

论坛徽章:
2
青铜圣斗士
日期:2015-11-26 06:15:59数据库技术版块每日发帖之星
日期:2016-07-24 06:20:00
128 [报告]
发表于 2012-04-28 02:08 |只看该作者
walleeee 发表于 2012-04-28 00:04
回复 98# OwnWaterloo

你还是不要牵扯其他人,这是我们之间的问题。你觉得你扯得还不够多?


我扯的能比得过你?我有回与不回某些人的自由;就像你有扯与不扯蛋的自由。


walleeee 发表于 2012-04-27 00:48
回复 52# OwnWaterloo

请继续看不起,老子不介意。另外,老子根本就谈不上看不看得起你,你关老子鸟事,我看得起你,看不起你,有鸟用,滚
艹,逼着老子发火,滚,滚,滚。众人见证,用你常说的话“群众眼睛雪亮”

不是人民群众的眼睛是雪亮的吗?人多不正好可以用雪亮的眼睛拆穿我?我都不怕你怕个卵。心虚了?

论坛徽章:
0
129 [报告]
发表于 2012-04-28 02:10 |只看该作者
回复 126# OwnWaterloo


常识或者说意识是这样,编译器不这样或者实现不了,我有什么办法?

p[0] + p[1] 与 character literal屁关系没有

我已经解释了多遍,你这个阅读障碍就是看不到,你是睁眼瞎?我说了,我只是为了完善而点出来,因为char+char会提升而导致一些误解,character literal是一个int也有类似误解。你看得懂不?我下回不回答这种感问题了。

你的推理从一开始就是狗屁,自然最终得到的也是狗屁

好,你继续认为我说的是p,我也继续认为你说的是p,我们两不相欠,如此甚好,你说呢?

论坛徽章:
0
130 [报告]
发表于 2012-04-28 02:15 |只看该作者
回复 128# OwnWaterloo


我有回与不回某些人的自由;就像你有扯与不扯蛋的自由。

好,我睡觉了。继续扯下去没意义。

我都不怕你怕个卵。心虚了?

心虚你个鸟,老子是懒得打字,懒得跟你扯,关键是费了这些对老子还没一点好处,看懂你这个阅读障碍对我有何意义?
打字很爽么?你去当打字员估计让你爽翻天。
群众眼镜当然雪亮,你这种货色不知道多少人心理明白,别人不说你,你还真把自己当回事?你继续,我也懒得阻碍你成就扯人霸业。

不过话说回来,你功夫真好,能在128楼扯到52楼的帖子,还扯到98楼的帖子,你真是能扯能汇总,不过就是阅读能力不怎么样,严重阅读障碍。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP