Tthe type jmp_buf is a typedef of an ARRAY.
As such, an array cannot be directly assigned to, only its elements.
This code produces the same error as the second program:
(Note the substitution of 'int' for 'int[1]' via typedef)
typedef int foo[1];
int main()
{
foo i;
foo *j = &i;
i = *j;
return 0;
}
Hope this helps,
-Eyal
At 02:00 PM 7/2/2001, Shaul Karl wrote:
>I have two 11 lines C programs which are supposed to be syntacticly similar.
>Yet int_test.c get compiled while the other does not:
>
>Script started on Mon Jul 2 14:51:10 2001
>[14:51:10 tmp]$ more *_test.c
>::::::::::::::
>int_test.c
>::::::::::::::
>
>#include <setjmp.h>
>
>int main()
>{
> int i;
> int *j = &i;
>
> i = *j;
> return 0;
>}
>::::::::::::::
>jmp_test.c
>::::::::::::::
>
>#include <setjmp.h>
>
>int main()
>{
> jmp_buf test_env;
> jmp_buf *test_env_p = &test_env;
>
> test_env = *test_env_p;
> return 0;
>}
>[14:51:25 tmp]$ cc -Wall -c int_test.c
>[14:51:47 tmp]$ cc -Wall -c jmp_test.c
>jmp_test.c: In function `main':
>jmp_test.c:9: incompatible types in assignment
>[14:51:56 tmp]$ exit
>exit
>
>Script done on Mon Jul 2 14:52:02 2001
>
>
>What did I miss?
>--
>
> Shaul Karl <[EMAIL PROTECTED]>
>
>Hillel used to say: If I am not for myself who will be for me?
>Yet, if I am for myself only, what am I? And if not now, when?
> (Ethics Of The Fathers 1:14)
>
>
>
>
>=================================================================
>To unsubscribe, send mail to [EMAIL PROTECTED] with
>the word "unsubscribe" in the message body, e.g., run the command
>echo unsubscribe | mail [EMAIL PROTECTED]
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]