Main Page | Report this Page
Computers Forum Index  »  Computer Compilers - LCC  »  extraneous old-style parameter list...
Page 1 of 1    

extraneous old-style parameter list...

Author Message
Robert Gilland...
Posted: Fri Jun 12, 2009 12:25 pm
Guest
ISC_QUAD * encode_date (yy, mm, dd);

int * yy;
int * mm;
int * dd;
{

struct tm t;

t.tm_year = yy;
t.tm_mon = mm;
t.tm_day = dd;
t.tm_sec = 0;
t.tm_min = 0;
t.tm_hour = 0;
t.tm_isdst = 0;

return gen_ib_date(&t);

};


Wedit output window build: Fri Jun 12 22:15:13 2009
Error e:\c\freeudflibc\date_functions.c: 83 extraneous old-style
parameter list
Error e:\c\freeudflibc\date_functions.c: 88 unrecognized declaration


What is happening here?
 
jacob navia...
Posted: Fri Jun 12, 2009 4:58 pm
Guest
Robert Gilland wrote:
Quote:
ISC_QUAD * encode_date (yy, mm, dd);

int * yy;
int * mm;
int * dd;
{

struct tm t;

t.tm_year = yy;
t.tm_mon = mm;
t.tm_day = dd;
t.tm_sec = 0;
t.tm_min = 0;
t.tm_hour = 0;
t.tm_isdst = 0;

return gen_ib_date(&t);

};


Wedit output window build: Fri Jun 12 22:15:13 2009
Error e:\c\freeudflibc\date_functions.c: 83 extraneous old-style
parameter list
Error e:\c\freeudflibc\date_functions.c: 88 unrecognized declaration


What is happening here?




ISC_QUAD * encode_date (yy, mm, dd);
^^^

erase that extraneous ";" after the function definition
 
Keith Thompson...
Posted: Sun Jun 14, 2009 11:16 am
Guest
jacob navia <jacob at (no spam) jacob.remcomp.fr> writes:
Quote:
Robert Gilland wrote:
ISC_QUAD * encode_date (yy, mm, dd);

int * yy;
int * mm;
int * dd;
{
[...]
};


Wedit output window build: Fri Jun 12 22:15:13 2009
Error e:\c\freeudflibc\date_functions.c: 83 extraneous old-style
parameter list
Error e:\c\freeudflibc\date_functions.c: 88 unrecognized declaration
[...]

ISC_QUAD * encode_date (yy, mm, dd);
^^^
erase that extraneous ";" after the function definition

Better yet, use prototypes rather than old-style function definitions:

ISC_QUAD *encode_date(int *yy, int *mm, int *dd)
{
/* ... */
}

--
Keith Thompson (The_Other_Keith) kst-u at (no spam) mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
 
Page 1 of 1    
All times are GMT
The time now is Wed Nov 25, 2009 2:54 am