bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] 03-getndelim2-c89.diff


From: James Youngman
Subject: Re: [Bug-gnulib] 03-getndelim2-c89.diff
Date: Thu, 24 Jul 2003 13:49:27 +0100
User-agent: Mutt/1.3.28i

On Thu, Jul 24, 2003 at 02:39:33PM +0200, Bruno Haible wrote:

> There's absolutely no point is changing function _definitions_ with
> no arguments to use (void). Both ways to write it are equivalent from
> the language point of view, and (void) is just useless clutter for the
> human reader. 

I'm not sure that's true :-

address@hidden:~$ nl -ba voidargs.c
     1  #include <stdio.h>
     2
     3  void voidargs1()
     4  {
     5    printf ("foo!");
     6  }
     7
     8  void voidargs2(void)
     9  {
    10    printf ("bar!");
    11  }
    12
    13  int main (int argc, char *argv[])
    14  {
    15    voidargs1();
    16    voidargs1('a');
    17    voidargs2();
    18    voidargs2('a');
    19    return 0;
    20  }
address@hidden:~$ gcc -Wall -W -g voidargs.c -o voidargs
voidargs.c: In function `main':
voidargs.c:18: too many arguments to function `voidargs2'
voidargs.c:13: warning: unused parameter `argc'
voidargs.c:13: warning: unused parameter `argv'

-- 
James Youngman.
CSSC Bug reporting page:       http://sf.net/tracker/?group_id=8064&atid=108064
GNU Findutils bug reporting page: http://savannah.gnu.org/bugs/?group=findutils




reply via email to

[Prev in Thread] Current Thread [Next in Thread]