Re: Problem with switch expression
- From: Peter Nilsson <airia@xxxxxxxxxxx>
- Date: Wed, 30 Jun 2010 15:52:14 -0700 (PDT)
Richard Heathfield <r...@xxxxxxxxxxxxxxx> wrote:
Ian Collins wrote:<snip>
karthik Tadikonda wrote:
#include<stdio.h>
main()
{
The compiler should at least complain about the old
style main.
Why?
For the same reason compilers should complain about
unprototyped function calls. Of course, many compilers
don't, although more and more do, even though they are
not required to.
It's worth pointing out that implicit int isn't just
deprecated, it was actually removed in C99. Whether you
believe C99 is important or not, you can't deny that there
was obviously a demand to move away from implicit int and
unprototyped functions. So, in that sense, the compiler
should complain, albeit in the form of a warning.
--
Peter
.
- Follow-Ups:
- Re: Problem with switch expression
- From: Richard Heathfield
- Re: Problem with switch expression
- Prev by Date: Re: Updating a pointer inside a reallocated block
- Next by Date: [OT] Re: Bad interview question
- Previous by thread: Re: Problem with switch expression
- Next by thread: Re: Problem with switch expression
- Index(es):
Relevant Pages
|