From: Vadim Zeitlin Date: Mon, 29 Nov 1999 09:45:21 +0000 (+0000) Subject: "no C++ comments in C files" rule X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/58aefa56e7ba8d562ba6f98ca601ff299c1646ba?ds=sidebyside "no C++ comments in C files" rule git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4762 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/html/standard.htm b/docs/html/standard.htm index 6cc90a9062..fc3c4db0a1 100644 --- a/docs/html/standard.htm +++ b/docs/html/standard.htm @@ -55,6 +55,7 @@ C++ portability guide by David Williams.
  • General recommendations
    1. +
    2. No C++ comments in C code>
    3. No global variables with constructor
    4. Turn on all warnings and eradicate them
    5. Don't rely on sizeof(int) == 2...
    6. @@ -361,6 +362,18 @@ which must be followed if you wish to write correct, i.e. working, progra also contains some C/C++ specific remarks in the end which are less important.
        +

      1. No C++ comments in C code>
      2. +Never use C++ comments in C code - not all C compilers/preprocessors +understand them. Although we're mainly concerned with C++ here, there are +several files in wxWindows sources tree which are compiled with C compiler. +Among them are include/wx/setup.h and include/wx/expr.h. + +Another thing related to C vs C++ preprocessor differences is that some old C +preprocessors require that all directives start in the first column (while +it's generally allowed to have any amount of whitespace before them in C++), +so you should start them in the beginning of the line in files which are +compiled with C compiler. +

      3. No global variables with constructors
      4. In C++, the constructors of global variables are called before the main() function (or WinMain() or any other program entry point)