Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

extraneous old-style parameter list

166 views
Skip to first unread message

Robert Gilland

unread,
Jun 12, 2009, 8:25:52 AM6/12/09
to robert....@basx.com.au
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

unread,
Jun 12, 2009, 8:58:37 AM6/12/09
to

^^^
erase that extraneous ";" after the function definition

Keith Thompson

unread,
Jun 14, 2009, 3:16:44 AM6/14/09
to
jacob navia <ja...@jacob.remcomp.fr> writes:
> 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) ks...@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"

0 new messages