Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Far typecasting error in code for M16C28

Status
Not open for further replies.

JaMe

Junior Member level 1
Junior Member level 1
Joined
Nov 8, 2006
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Indonesia
Activity points
1,406
when I compiled this code,

const char* name= dir_entry->long_name;
char * name_ext;

name_ext = strrchr(name, '.');

compiler shows warning warning message:
[Warning(ccom)] assign far pointer to near pointer,bank value ignored
===> name_ext = strrchr(name, '.');

I am using High-performance Embedded Workshop by Renesas Technology.
The microcontroller is M16C28, which is 16-bit processor. Any idea about this ?
 

Re: Far Typecasting

I've checked in my HEW environment,
typedef unsigned char byte;

const byte *name = "12.67";

void main(void)
{
byte *name_ext;
................................

name_ext = strrchr(name, '.');
...................................
}

I'm not getting any warning here. FYI, I'm working on R8C tiny (R5F21237) CPU.
I think you can check this code in your HEW environment.
There may problem with your structure.

Nandu
 

Far Typecasting

It just means that the compiler can't use a more compact address mode and is using a larger address mode given the demands you are placing on this pointer.It probably ran out of space in a data segment and had to put some data in another segment and this resulted in smoe bank switching that the compiler would call a far ponter. But there could be a lot of other reasons. It depends on the micro,
To understand how C pointer work I alway tell a programmer to learn how the assembly language and address modes work for a particular micro. Then how C pointers work for that particular platform becomes self-evident.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top