cc -c -o /home/hys545/tmp/1/thunks.e lib/thunks.c lib/thunks.c: In function `newthunk': lib/thunks.c:33: error: invalid operands to binary -
33c33 < *(int *)(tp->code + offset) = (unsigned char *)f - (tp->code + offset + 4); --- > *(int *)(tp->code + offset) = (char *)f - (tp->code + offset + 4);
33c33 < *(int *)(tp->code + offset) = (char *)f - ((char *)tp->code + offset + 4); --- > *(int *)(tp->code + offset) = (char *)f - (tp->code + offset + 4);
25c25 < struct thunk *tp = malloc(sizeof tp); --- > struct thunk *tp = malloc(sizeof *tp);
아래는 포인터 연산과 관련하여 TCPL에서 발췌한 내용입니다.
TCPL page 103. The valid pointer operations are assignment of pointers of the same type, adding or subtracting a pointer and an integer, subtracting or comparing two pointers to members of the same array, and assigning or comparing to zero.
The valid pointer operations are assignment of pointers of the same type, adding or subtracting a pointer and an integer, subtracting or comparing two pointers to members of the same array, and assigning or comparing to zero.
25c25 < struct thunk *tp = malloc(sizeof tp); --- > struct thunk *tp = malloc(sizeof *tp); 덧붙여서 이것도 해주셔야 할 듯.
그렇군요. '*'만 보고 포인터라고 생각했습니다. :oops:
텍스트 포맷에 대한 자세한 정보
<code>
<blockcode>
<apache>
<applescript>
<autoconf>
<awk>
<bash>
<c>
<cpp>
<css>
<diff>
<drupal5>
<drupal6>
<gdb>
<html>
<html5>
<java>
<javascript>
<ldif>
<lua>
<make>
<mysql>
<perl>
<perl6>
<php>
<pgsql>
<proftpd>
<python>
<reg>
<spec>
<ruby>
<foo>
[foo]
[code:1]33c33< *(int *
를 하셔야 겠습니다.
덧붙여서 이것도 해주셔야 할 듯.
아래는 포인터 연산과 관련하여 TCPL에서 발췌한 내용입니다.
[quote="kane"][code:1]25c25<
그렇지는 않을 겁니다.
malloc(sizeof tp)는 malloc(sizeof(struct thunk*))
malloc(sizeof *tp)는 malloc(sizeof(struct thunk)),
와 같습니다.
그렇군요. '*'만 보고 포인터라고 생각했습니다. :oops:
그렇군요. '*'만 보고 포인터라고 생각했습니다. :oops:
댓글 달기