From: SourceForge.net <no...@so...> - 2003-02-09 20:11:34
|
Bugs item #680076, was opened at 2003-02-04 09:37 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=680076&group_id=599 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Vladimir Támara Patiño (vtamara) Assigned to: Nobody/Anonymous (nobody) >Summary: Comparing function with pointer to void Initial Comment: /* Cannot compare pointer to function (left) with pointer to void (right). */ int f(int (*a)(void), void *v) { if (a==v) { return 1; } else { return 0; } } /* $ sdcc -c binary-pvoid.c binary-pvoid.c:7: error: compare operand cannot be struct/union comparing type int function code * to type void generic * -:0: error: code not generated for 'f' due to previous errors The problem doesn't occurr if the order of a and v is interchanged i.e if (v==a) ... I could fix the problem in SDCCsymt.c by casting to void * if one of the operands is void *. The patch has line numbers different (since I applied other patches that I already sent). */ ---------------------------------------------------------------------- Comment By: Vladimir Támara Patiño (vtamara) Date: 2003-02-09 20:51 Message: Logged In: YES user_id=8034 I found a problem introduced by the first and second patch. Code for the following portion would be incorrectly generated. --- int f(void *v) { return *((int *)v); } --- The third patch solves the original bug and produces correct code for this case. The other problem that I have still not fixed arises with: --- #define NULL ((void *)0) void (*j_userFun)(void)=NULL; --- casting2-pvoid.c:5: error: pointer types incompatible from type 'void generic * ' to type 'void function code * ' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=680076&group_id=599 |
From: SourceForge.net <no...@so...> - 2003-02-24 15:36:59
|
Bugs item #680076, was opened at 2003-02-04 08:37 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=680076&group_id=599 Category: None Group: None >Status: Closed Resolution: None Priority: 5 Submitted By: Vladimir Támara Patiño (vtamara) >Assigned to: Johan Knol (johanknol) Summary: Comparing function with pointer to void Initial Comment: /* Cannot compare pointer to function (left) with pointer to void (right). */ int f(int (*a)(void), void *v) { if (a==v) { return 1; } else { return 0; } } /* $ sdcc -c binary-pvoid.c binary-pvoid.c:7: error: compare operand cannot be struct/union comparing type int function code * to type void generic * -:0: error: code not generated for 'f' due to previous errors The problem doesn't occurr if the order of a and v is interchanged i.e if (v==a) ... I could fix the problem in SDCCsymt.c by casting to void * if one of the operands is void *. The patch has line numbers different (since I applied other patches that I already sent). */ ---------------------------------------------------------------------- >Comment By: Johan Knol (johanknol) Date: 2003-02-24 15:45 Message: Logged In: YES user_id=63512 fixed in SDCCast.c:1.166 ---------------------------------------------------------------------- Comment By: Vladimir Támara Patiño (vtamara) Date: 2003-02-09 19:51 Message: Logged In: YES user_id=8034 I found a problem introduced by the first and second patch. Code for the following portion would be incorrectly generated. --- int f(void *v) { return *((int *)v); } --- The third patch solves the original bug and produces correct code for this case. The other problem that I have still not fixed arises with: --- #define NULL ((void *)0) void (*j_userFun)(void)=NULL; --- casting2-pvoid.c:5: error: pointer types incompatible from type 'void generic * ' to type 'void function code * ' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=680076&group_id=599 |
From: SourceForge.net <no...@so...> - 2003-02-24 15:37:54
|
Bugs item #680076, was opened at 2003-02-04 08:37 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=680076&group_id=599 Category: None Group: None Status: Closed Resolution: None Priority: 5 Submitted By: Vladimir Támara Patiño (vtamara) Assigned to: Johan Knol (johanknol) Summary: Comparing function with pointer to void Initial Comment: /* Cannot compare pointer to function (left) with pointer to void (right). */ int f(int (*a)(void), void *v) { if (a==v) { return 1; } else { return 0; } } /* $ sdcc -c binary-pvoid.c binary-pvoid.c:7: error: compare operand cannot be struct/union comparing type int function code * to type void generic * -:0: error: code not generated for 'f' due to previous errors The problem doesn't occurr if the order of a and v is interchanged i.e if (v==a) ... I could fix the problem in SDCCsymt.c by casting to void * if one of the operands is void *. The patch has line numbers different (since I applied other patches that I already sent). */ ---------------------------------------------------------------------- >Comment By: Johan Knol (johanknol) Date: 2003-02-24 15:46 Message: Logged In: YES user_id=63512 fixed in SDCCast.c:1.166 ---------------------------------------------------------------------- Comment By: Johan Knol (johanknol) Date: 2003-02-24 15:45 Message: Logged In: YES user_id=63512 fixed in SDCCast.c:1.166 ---------------------------------------------------------------------- Comment By: Vladimir Támara Patiño (vtamara) Date: 2003-02-09 19:51 Message: Logged In: YES user_id=8034 I found a problem introduced by the first and second patch. Code for the following portion would be incorrectly generated. --- int f(void *v) { return *((int *)v); } --- The third patch solves the original bug and produces correct code for this case. The other problem that I have still not fixed arises with: --- #define NULL ((void *)0) void (*j_userFun)(void)=NULL; --- casting2-pvoid.c:5: error: pointer types incompatible from type 'void generic * ' to type 'void function code * ' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=680076&group_id=599 |
From: SourceForge.net <no...@so...> - 2003-02-24 15:38:52
|
Bugs item #680076, was opened at 2003-02-04 08:37 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=680076&group_id=599 Category: None Group: None Status: Closed Resolution: None Priority: 5 Submitted By: Vladimir Támara Patiño (vtamara) Assigned to: Johan Knol (johanknol) Summary: Comparing function with pointer to void Initial Comment: /* Cannot compare pointer to function (left) with pointer to void (right). */ int f(int (*a)(void), void *v) { if (a==v) { return 1; } else { return 0; } } /* $ sdcc -c binary-pvoid.c binary-pvoid.c:7: error: compare operand cannot be struct/union comparing type int function code * to type void generic * -:0: error: code not generated for 'f' due to previous errors The problem doesn't occurr if the order of a and v is interchanged i.e if (v==a) ... I could fix the problem in SDCCsymt.c by casting to void * if one of the operands is void *. The patch has line numbers different (since I applied other patches that I already sent). */ ---------------------------------------------------------------------- >Comment By: Johan Knol (johanknol) Date: 2003-02-24 15:47 Message: Logged In: YES user_id=63512 fixed in SDCCast.c:1.166 ---------------------------------------------------------------------- Comment By: Johan Knol (johanknol) Date: 2003-02-24 15:46 Message: Logged In: YES user_id=63512 fixed in SDCCast.c:1.166 ---------------------------------------------------------------------- Comment By: Johan Knol (johanknol) Date: 2003-02-24 15:45 Message: Logged In: YES user_id=63512 fixed in SDCCast.c:1.166 ---------------------------------------------------------------------- Comment By: Vladimir Támara Patiño (vtamara) Date: 2003-02-09 19:51 Message: Logged In: YES user_id=8034 I found a problem introduced by the first and second patch. Code for the following portion would be incorrectly generated. --- int f(void *v) { return *((int *)v); } --- The third patch solves the original bug and produces correct code for this case. The other problem that I have still not fixed arises with: --- #define NULL ((void *)0) void (*j_userFun)(void)=NULL; --- casting2-pvoid.c:5: error: pointer types incompatible from type 'void generic * ' to type 'void function code * ' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=680076&group_id=599 |