Re: Problem with switch expression



Richard Heathfield <r...@xxxxxxxxxxxxxxx> wrote:
Ian Collins wrote:
karthik Tadikonda wrote:
#include<stdio.h>
main()
{
<snip>
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
.



Relevant Pages

  • Re: C99: Suggestions for style(9)
    ... started and a decade ago there was a new C standard. ... switched to C99 as default ... so not any more old style declarations are added. ... how today's compilers handle unaliased local variables. ...
    (freebsd-hackers)
  • Re: Another C99 challenge
    ... reason to believe that GCC is lying about their own work? ... C99-specific features anyway, at least in delivered code, until our ... I wouldn't mind if GCC did fully support C99, ... compilers using a "reasonable" variety of features new to C99. ...
    (comp.std.c)
  • Re: Urgent C Questions
    ... compilers, it will take a miracle ... There have been suggestions within ISO C to drop some features of C99 ... Neither group needs to see the C standard change much, ... Randy Howard ...
    (comp.lang.c)
  • Re: Why the C committee doesnt provide an implementation when the standard is published?
    ... It is THE de-facto standard on the desktop. ... have pointed out recently the current crop of MS compilers are very good ... diverged one way whilst C went a different way 95 and C99. ... and quite a number of C99 language features. ...
    (comp.lang.c)
  • Re: moving average
    ... creates an implicit declaration "int exit;". ... In C99 no such ... implicit declaration is created, but full C99 compilers are rare, ...
    (comp.lang.c)