From: SourceForge.net <no...@so...> - 2006-12-06 17:04:37
|
Bugs item #1609244, was opened at 2006-12-05 15:19 Message generated for change (Comment added) made by maartenbrock You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1609244&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: C-Front End >Group: fixed >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Maarten Brock (maartenbrock) >Assigned to: Maarten Brock (maartenbrock) Summary: function return value mismatch Initial Comment: Compiling the following code generates two warnings and finally broken code: typedef char * PCHAR; char KAR; PCHAR foo(void) reentrant //this fails { return &KAR; } PCHAR bar(void) // this is ok { return &KAR; } sdcc -c bug.c bug.c:7: warning 60: function return value mismatch from type 'char near* ' to type 'char generic* unknown type' bug.c:5: warning 59: function 'foo' must return value Used SDCC 2.6.1 #4471 ;------------------------------------------------------------ ; bug.c:5: PCHAR foo(void) reentrant //this fails ; ----------------------------------------- ; function foo ; ----------------------------------------- _foo: ; bug.c:7: return &KAR; <<<<< NO CODE GENERATED ; Peephole 300 removed redundant label 00101$ ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'bar' ;------------------------------------------------------------ ;------------------------------------------------------------ ; bug.c:10: PCHAR bar(void) // this is ok ; ----------------------------------------- ; function bar ; ----------------------------------------- _bar: ; bug.c:12: return &KAR; ; genRet ; Peephole 182.a used 16 bit load of DPTR mov dptr,#_KAR mov b,#0x40 ; Peephole 300 removed redundant label 00101$ ret ---------------------------------------------------------------------- >Comment By: Maarten Brock (maartenbrock) Date: 2006-12-06 18:04 Message: Logged In: YES user_id=888171 Originator: YES Fixed in SDCC 2.6.2 #4503. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1609244&group_id=599 |