This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Why is -Wold-style-definition off by default?
- From: Martin Sebor <msebor at gmail dot com>
- To: Antons Suspans <antox at ml dot lv>, gcc-help at gcc dot gnu dot org
- Date: Wed, 1 Nov 2017 17:59:54 -0600
- Subject: Re: Why is -Wold-style-definition off by default?
- Authentication-results: sourceware.org; auth=none
- References: <20171030122043.GC21898@ax.s16>
On 10/30/2017 06:20 AM, Antons Suspans wrote:
Hello!
Why is -Wold-style-definition off by default and not implied by -Wall,
-Wextra? The following code might be a marginal example, which is
compiled without warning about missing prototype and unchecked args
(gcc-5.3.0 -Wall -Wextra ex.c).
I recently wondered the same thing. Functions without a prototype
have been deprecated since C99. As the C committee is starting to
work on C2X it will consider removing (a subset of) deprecated features.
I think it would make sense to include the option in -Wall now, well
ahead of C2X being finalized (it arguably should been done years ago).
If you'd like to see such a change I suggest opening a request in Bugzilla.
Martin
void f(x)
int x;
{ }
int main(void) {
f(1.0);
return 0;
}
Thanks,
Antons