extraneous old-style parameter list

  • Follow


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?



0
Reply rgilland1966 (2) 6/12/2009 12:25:52 PM

Robert Gilland wrote:
> 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
0
Reply jacob 6/12/2009 12:58:37 PM


jacob navia <jacob@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) kst-u@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
Reply Keith 6/14/2009 7:16:44 AM

2 Replies
402 Views

(page loaded in 0.439 seconds)

Similiar Articles:













7/20/2012 8:21:30 PM


Reply: