It's one of the nicer things about the DM compiler (though it's looking very long in the tooth nowadays). I just wish all the compiler vendors (MS VC++, Intel, et al) would all look at each other and port the best bits. I still cannot believe that MS C++ has no support for the ubquitous (but non-standard) 0b010101 binary format (or %b in it's printf() function). Interestingly, I once had cause to use some Microsoft supplied headers (MFC or Windows Platform API, can't remember which) but the DM compiler found several such mistakes in the headers. I duly reported them to MS and felt quite smug ;-) Paul
Jummna
Posts
-
Missing '=' in if-statement -
Missing empty brackets in function call.Another one (this isn't doing my resume much good, is it?) int some_func () { return flag; } if (some_func) { /* Always end up heree */ } The error is missing out the () after some_func in the if condition. Paul
-
Missing "case" keyword in switch() statement.OK, so I've done this before, always in a large switch statement where the case names are quite long (and so the missing "case" keyword isn't so obvious): switch () { case A: case B: C: case D: } The C: is seen as a label and compiled as such. Paul
-
Semicolon after if-statementAgain, as I just posted, as someone who uses the Digital Mars C++ compiler (formerly Symantec C++ and before that Zortech or the like) I never get this problem as the compiler always warns of the semi=colon. In the unlikely case where you do want a semicolon, to keep the compiler happy, you just need to insert some C comment: while (flag) /* Wait */; Paul
-
Missing '=' in if-statementAs someone who uses the Digital Mars C++ compiler (formerly Symantec C++ and before that Zortech or the like) I never get this problem as the compiler always warns of an unintended assignment. If you *do* intend to do an assignement then you need to code: if ((flag=value)==TRUE) ... or similar. I.e. the compiler makes you be explicit about what you're writing.