Bugs item #2084206, was opened at 2008-08-30 18:57
Message generated for change (Comment added) made by maartenbrock
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100599&aid=2084206&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: Pierre Gaufillet (pgaufillet)
Assigned to: Maarten Brock (maartenbrock)
Summary: error on printf with a fonctor member of a structure
Initial Comment:
When compiling:
"#include <stdio.h>
typedef struct {
void (*main) (void);
} Data;
extern Data data;
void main(void)
{
printf("%x",data.main);
}
"
with "sdcc -c file.c", I get:
"Internal error: validateLink failed in SPEC_NOUN(parms->ftype) @ SDCCicode.c:3350: expected SPECIFIER, got null-link"
using "SDCC : pic16 2.8.0 #5117 (Aug 17 2008) (UNIX)"
----------------------------------------------------------------------
>Comment By: Maarten Brock (maartenbrock)
Date: 2011-03-15 11:17
Message:
Pierre,
I do have a warning though. The pointer is passed as a (generic) pointer,
not as an integer. For at least the mcs51 which has a generic pointer type
that is larger than the integer type this means the %x will not work
correctly. Printing pointers should be done with %p.
Maarten
----------------------------------------------------------------------
Comment By: Pierre Gaufillet (pgaufillet)
Date: 2011-03-15 10:51
Message:
Thanks Maarten :-)
----------------------------------------------------------------------
Comment By: Maarten Brock (maartenbrock)
Date: 2011-03-13 22:20
Message:
Fixed in SDCC 3.0.1 #6287.
----------------------------------------------------------------------
Comment By: Crazor (craz0r)
Date: 2009-03-04 15:25
Message:
Same happens when compiling for mcs51...
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100599&aid=2084206&group_id=599
|