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), 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.

One good reason for passing C though a C++ compiler:

"/tmp/x.c", line 16: Error: Cannot use const char[82] to initialize
char[81].

--
Ian Collins.
.



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: 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)
  • Re: Simplicity has a future
    ... c.c:64: error: implicit declaration of function ?toupper? ... My C compiler gave several screens of errors and warning before giving up. ... C99 compiler from somewhere (and I don't claim that the program is valid ...
    (comp.lang.c)