On Mon, 3 Aug 2009, roelof 't Hooft wrote:
> Hi guys,
>
> This is driving me nuts, I have been searching in all the
> obvious places for information on this but still can not
> find what is wrong :
>
> utilities.h:15: error 7: Old style C declaration. IGNORED 'Delay'
> utilities.h:15: error 141: two or more data types in declaration for
> 'Delay'
>
> In the header file I have this :
>
> void Delay(uint16_t);
>
>
> And this is in the source file :
>
> /*********************************************************
> * Delay the program for a certain amount of time.
> * The delay time is (6 + 10 * time) * 543nS
> *
> * time mSec
> * 10 0,057
> * 50 0,274
> * 100 0,546
> * 200 1,089
> * 400 2,175
> *********************************************************/
> void Delay(uint16_t time)
> {
> uint16_t i;
>
> for(i = 0; i < time; i++)
> {
> }
> }
I think the declaration for uint16_t is missing. You should have
#include <stdint.h>
somewhere before using uint16_t. Otherwise, the compiler thinks you are
trying to use the old K&R rule that an identifier that hasn't been given a
type defaults to int. So in
void Delay(uint16_t);
the compiler thinks you are trying to declare a function prototype that
takes a parameter named "uint16_t" (since it doesn't know this was
supposed to be a type rather than a parameter name) that has an implicit
type of "int".
Erik
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user