Searching \ for '[PIC]: CCS Compiler question' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'CCS Compiler question'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: CCS Compiler question'
2002\01\30@205815 by Barry Michels

flavicon
face
Can variables be used as arguments in a function call?????

This is driving me nuts!  Here's my code:


int16 AvailRAM;  //global variable

void test_ram()
{
   int16 addr=0;   //local variable

   do
   {
       write_ram(addr, 0xAA);       //write 0xAA to each ram location
   } while(read_ram(addr++)==0xAA);   //until a bad or non-existant
location is reached
   AvailRAM = addr-1;
}


Here's the error:
Error[107]   C:\LOW.C 610 : Structures and Unions can not be parameters (use
* or &)
Line 610 is the write_ram(addr, 0xAA); line

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


2002\01\30@211253 by Dale Botkin

flavicon
face
On Wed, 30 Jan 2002, Barry Michels wrote:

> Can variables be used as arguments in a function call?????

Well, yeah, I do it all the time...  would be tough to write code
otherwise!

{Quote hidden}

What's the function declaration for write_ram() look like?  It doesn't
look to me like you're using a struct or union as a parameter, it's just a
long (well, int16, which is a long to CCS at least).  What compiler
version?

Dale

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body


2002\01\30@211857 by Barry Michels

flavicon
face
----- Original Message -----
From: "Dale Botkin" <dalespamKILLspamBOTKIN.ORG>
To: <.....PICLISTKILLspamspam.....MITVMA.MIT.EDU>
Sent: Wednesday, January 30, 2002 9:11 PM
Subject: Re: [PIC]: CCS Compiler question


> What's the function declaration for write_ram() look like?  It doesn't
> look to me like you're using a struct or union as a parameter, it's just a
> long (well, int16, which is a long to CCS at least).  What compiler
> version?

Doesn't look like a struct or union to me either...

int8 read_ram(int16 addr)
void write_ram(int16 addr, int8 dta8)

It's the latest version since I just bought it last week.  3.071


Barry

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspam_OUTspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body


2002\01\30@224346 by Dale Botkin

flavicon
face
Weird.  Works fine for me:

int16 AvailRAM;

char read_ram(int16 addr){

return 0;

}

void write_ram(int16 addr, int8 dta8) {

}

void main() {

   int16 addr=0;   //local variable

   do
   {
       write_ram(addr, 0xAA);       //write 0xAA to each ram location
   } while(read_ram(addr++)==0xAA);   //until a bad or non-existant
                                    // location is reached
   AvailRAM = addr-1;
}

I'm using 3.070, haven't installed 3.073 yet.  Might want to post this on
the CCS user forum, or just try 3.073 -- maybe it's specific to that
version or something?

Dale
--
"Curiosity is the very basis of education and if you tell me that
curiosity killed the cat, I say only the cat died nobly."
         - Arnold Edinborough


On Wed, 30 Jan 2002, Barry Michels wrote:

> {Original Message removed}

2002\01\31@013054 by David Koski

flavicon
face
On Wed, 30 Jan 2002 21:42:14 -0600
Dale Botkin <dalespamspam_OUTBOTKIN.ORG> wrote:

> Weird.  Works fine for me:
>
> int16 AvailRAM;

Just a poke in the dark but where is int16 defined?

David
@spam@davidKILLspamspamKosmosIsland.com

--
http://www.piclist.com hint: To leave the PICList
KILLspampiclist-unsubscribe-requestKILLspamspammitvma.mit.edu


2002\01\31@071033 by Barry Michels

flavicon
face
Must be part of the compiler.  I have about 30 functions so far and I'm only
having this problem with 3 of them....

Barry

{Original Message removed}

2002\01\31@101607 by Dale Botkin

flavicon
face
It's a built in type specifier.

Dale
--
"Curiosity is the very basis of education and if you tell me that
curiosity killed the cat, I say only the cat died nobly."
         - Arnold Edinborough


On Wed, 30 Jan 2002, David Koski wrote:

> On Wed, 30 Jan 2002 21:42:14 -0600
> Dale Botkin <RemoveMEdaleTakeThisOuTspamBOTKIN.ORG> wrote:
>
> > Weird.  Works fine for me:
> >
> > int16 AvailRAM;
>
> Just a poke in the dark but where is int16 defined?

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-requestspamBeGonespammitvma.mit.edu


2002\01\31@173148 by Kevin J. Maciunas

flavicon
picon face
On Thu, 2002-01-31 at 22:40, Barry Michels wrote:
> Must be part of the compiler.  I have about 30 functions so far and I'm only
> having this problem with 3 of them....
>
> Barry
>
...
{Quote hidden}

"int16" is a CCS-C type specifier.  Check out the "Data Definitions"
section of the manual.  They also have int1 ( :-) ), int8, int32.  For
one application I wrote I actually needed int24 which they don't
provide.

Cheers
/Kevin
--
Kevin J. Maciunas              Net: RemoveMEkevinspamTakeThisOuTcs.adelaide.edu.au
Dept. of Computer Science      Ph : +61 8 8303 5845
University of Adelaide         Fax: +61 8 8303 4366
Adelaide 5005 SOUTH AUSTRALIA  Web: http://www.cs.adelaide.edu.au/~kevin
Fingerprint = 7E5A A0C2 22BC 5993 17F2 93CE B1FD DEC6 D0C0 50CD

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestEraseMEspam.....mitvma.mit.edu


2002\01\31@194212 by Barry Michels

flavicon
face
The new version compiles now with no changes.  Funny, this bug fix isn't
listed in the 3.073 bug list.....

Barry

{Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...