Re: Simplicity has a future



Richard Heathfield wrote:
Ian Collins said:

Harald van D?k wrote:

c.c: In function ?main?:
c.c:17: error: type defaults to ?int? in declaration of ?i?
c.c:20: error: expected ?,? or ?;? before ?)? token
c.c:64: error: implicit declaration of function ?toupper?
c.c:69: error: implicit declaration of function ?tolower?

That's compiling as C, not as C++.

My C compiler gave several screens of errors and warning before giving up.

Try it again, fixing the trivial error on line 20 (for which I apologise).
Any errors you get then will be either because you have managed to dig up a
C99 compiler from somewhere (and I don't claim that the program is valid
C99),

You claimed the program was valid C. Silly me for assuming you would
refer to an older standard without stating so.

That aside, though, your rules are obviously intentionally
unreasonable, as it is entirely possible to modify your program to make
it valid C++ without modifying either its "essential character" or its
output.

or because your compiler is simply issuing diagnostics for the sake
of it. Modulo the linesplice accident, the program is, as far as I'm aware,
a legal C90 program.

.



Relevant Pages

  • Re: introduction to programming
    ... Location Bar and type `strict' in the filter input. ... I know two extensions that allow you to ... All the efficient scripting languages I've used are what we used to call "compile & go" in the sense that there's no visible compiler. ... PLAN 3 and PLAN 4 were greeted with cheers because they dropped implicit declaration. ...
    (comp.lang.javascript)
  • Re: strcpy warning
    ... >>Consistent indenting will make your programs much easier to read. ... You don't #include libraries. ... This is usually a Bad Thing, since the implicit declaration may not ... compiler or it could be using different default settings. ...
    (comp.lang.c)
  • Re: compiler behaviour, exported symbols, linking
    ... miban() from second module. ... Implicit 'int' was dropped in C99. ... with only implicit declaration warning ... A different C99 compiler (and ...
    (comp.lang.c)
  • Re: Newbie question on time()
    ... Just using your compiler to determine the ... int intResult = 0; ... perhaps you should increase the warning level. ... implicit declaration of function 'srand' ...
    (comp.lang.c)
  • Re: implicit declaration of function???
    ... I got this error "implicit declaration of function" ... visible to the compiler at the point where it was compiling a call to ... The prototype for certain functions are missing in the header files. ...
    (comp.lang.c)