[gentoo-user] Strange GCC behavior

2011-09-29 Thread Nilesh Govindarajan
Default function arguments in C are specified like this: int func(int a = 10) {} // just a dummy function Now I save that in a file called foo.c The above piece of code is valid in C as well as C++ Now see this: nilesh@Linux ~ $ cat /tmp/foo.c int func(int a = 1) {} nilesh@Linux ~ $ gcc

Re: [gentoo-user] Strange GCC behavior

2011-09-29 Thread Michael Mol
On Thu, Sep 29, 2011 at 1:27 PM, Nilesh Govindarajan cont...@nileshgr.com wrote: Default function arguments in C are specified like this: int func(int a = 10) {} // just a dummy function Now I save that in a file called foo.c The above piece of code is valid in C as well as C++ Now see

Re: [gentoo-user] Strange GCC behavior

2011-09-29 Thread Todd Goodman
* Nilesh Govindarajan cont...@nileshgr.com [110929 13:33]: Default function arguments in C are specified like this: int func(int a = 10) {} // just a dummy function No they're not. C doesn't have default function arguments. Now I save that in a file called foo.c The above piece of

Re: [gentoo-user] Strange GCC behavior

2011-09-29 Thread Nilesh Govindarajan
On Thu 29 Sep 2011 11:10:00 PM IST, Michael Mol wrote: On Thu, Sep 29, 2011 at 1:27 PM, Nilesh Govindarajan cont...@nileshgr.com wrote: Default function arguments in C are specified like this: int func(int a = 10) {} // just a dummy function Now I save that in a file called foo.c The

Re: [gentoo-user] Strange GCC behavior

2011-09-29 Thread Michael Mol
On Thu, Sep 29, 2011 at 1:43 PM, Todd Goodman t...@bonedaddy.net wrote: * Nilesh Govindarajan cont...@nileshgr.com [110929 13:33]: Default function arguments in C are specified like this: int func(int a = 10) {} // just a dummy function No they're not.  C doesn't have default function

Re: [gentoo-user] Strange GCC behavior

2011-09-29 Thread Nilesh Govindarajan
On Thu 29 Sep 2011 11:13:54 PM IST, Todd Goodman wrote: * Nilesh Govindarajan cont...@nileshgr.com [110929 13:33]: Default function arguments in C are specified like this: int func(int a = 10) {} // just a dummy function No they're not. C doesn't have default function arguments. Now I

Re: [gentoo-user] Strange GCC behavior

2011-09-29 Thread David W Noon
On Thu, 29 Sep 2011 22:57:25 +0530, Nilesh Govindarajan wrote about [gentoo-user] Strange GCC behavior: Default function arguments in C are specified like this: int func(int a = 10) {} // just a dummy function Now I save that in a file called foo.c The above piece of code is valid in C