Compiler error forward declaration.

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hallo, gentlemen:

After a long time without programming in C, neither working with uC, now I've managed to have some time to start up a (not so) new design writing some code for it in AVRStudio 5 and ASF. I wish to add it to the contest, but I doubt I could finist it on time, even if I could finish it at all...

Now, to the question. When I try to compile it, the compiler complains about a prototype definition that I have in a drivers.h file, with the message "Parameter XXX has just a forward declaration". I don't have a clue of which is the cause of this problem.

The function is declared into Drivers.C, drivers.h is included into at the end of the 'standard' declarations, and asf.h is included into main.c and Drivers.c. Can someone point me in the right direction, please?

Thank you very much in advance,

Guillem.
"Common sense is the least common of the senses" Anonymous.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Now, to the question. When I try to compile it, the compiler complains about a prototype definition that I have in a drivers.h file, with the message "Parameter XXX has just a forward declaration". I don't have a clue of which is the cause of this problem.
Post the file involved and identify which line number.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, Cliff:

Thanks for your really fast response.

Attached you can find the two files, but I'm considering to add the whole project zipped.

Attachment(s): 

Guillem.
"Common sense is the least common of the senses" Anonymous.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As you may have found with Google this error usually occurs when semi-colons have inadvertently been used.

Now see Drivers.c (I picked the right file to download first! ;-))

char SPI_Sync(SPI_t *SPIPort; char *Buff; U16 Count)

Spot anything wrong there? :-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

:oops: :oops: I feel dumb... :oops: :oops:

First of all, thank you very much for your help to this noob programer...

Maybe I'm too used to Pascal (or similar) that is what i'm using right now (in fact an interpreted version for a rare PC program).

Now it compiles fine...

Curiously my search (at AVRFreaks, not at Google) didn't reveal anything about this particular message. Now I checked again in Google, and found it, after some struggling and filtering.

Guillem.
"Common sense is the least common of the senses" Anonymous.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

at AVRFreaks, not at Google

There's your problem. There are 100's of 1,000's of people using GCC. Very few of those are using the AVR variant. So if you ever get an error just type the words (not specific symbol names) into Google and you'll find 1,000 people who've encountered it before (probably on the i386 version of GCC)

On this occasion this is one time I actually prefer M$ to GCC. Like IBM every one of their errors and warnings has a code number. You just type that code number into Google and you find masses of previous examples - also the top link (virtually every time) is a full explanation on the MSDN site. I have to say I like this particular aspect of M$ ;-) A simple example is a variable that is defined but not used. M$ give warning C4101 for this so you Google "C4101" and end up at:

http://msdn.microsoft.com/en-us/...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, Cliff. You've identified one of the drawbacks of community-developed software in general, and one with many variants like gcc in particular. Who would hand out different number series to all those different variants? Who would make sure two errors didn't use the same number? Etc..

Won't happen unless you have a very hierarchical project organization. So, won't happen for gcc.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Few months ago I was coding in C# also, and I agree with you regarding the support one can find with MS systems. A pity that I found problem when trying to use a library (sorr, I hate libraries always, even those I wrote) for communications (http://www.matrixplatform.com/in...) and I got some problems when trying to add some functionality and convert the program to a .dll that should be used by another software (the one that I use more often, that uses an interpreted derivative of Pascal: http://www.mcd-elektronik.de/eng...).

I had no problems regarding the MS part of the library, but many when trying to use the remaining part. It seems that I will have to switch to http://msdn.microsoft.com/en-us/....

Now I understand why many colleages here are bald... (please, don't get offended)

Guillem.
"Common sense is the least common of the senses" Anonymous.