Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++ - Code checking
Hi, I am using the C compiler with the maximum checking option I found, -A -w- -r. However, the compiler does not check the possible errors as I would like, ie : - I declared main() as returning a void, and the compiler did not complain. - I declared a function returning an int, and I do not use return statement in the function body. Again, the compiler does not complain. - I use a function without declaring the prototype. The compiler says nothing. Is there a compiler option I have not seen, or the compiler does not make these controls ? Thx SD Oct 05 2002
In article <ann0hg$16cs$1 digitaldaemon.com>, SD (stephanedelaval wanadoo.fr) says...Hi, I am using the C compiler with the maximum checking option I found, -A -w- -r. However, the compiler does not check the possible errors as I would like, ie : - I declared main() as returning a void, and the compiler did not complain. - I declared a function returning an int, and I do not use return statement in the function body. Again, the compiler does not complain. - I use a function without declaring the prototype. The compiler says nothing. Is there a compiler option I have not seen, or the compiler does not make these controls ? Oct 05 2002
Thk for the prompt reply. You are suggesting a very good solution. However I used the -cpp option of the sc.exe dmars compiler, and it still have the same problem. Is there another C++ compiler in the digital mars package ? Except for this flag, I have not seen any reference for it... SDIn article <ann0hg$16cs$1 digitaldaemon.com>, SD (stephanedelaval wanadoo.fr) says...Hi, I am using the C compiler with the maximum checking option I found, -A -w- -r. However, the compiler does not check the possible errors as I would like, ie : - I declared main() as returning a void, and the compiler did not complain. - I declared a function returning an int, and I do not use return statement in the function body. Again, the compiler does not complain. - I use a function without declaring the prototype. The compiler says nothing. Is there a compiler option I have not seen, or the compiler does not make these controls ? Oct 05 2002
In article <ann7mi$1cj9$1 digitaldaemon.com>, SD says...However, the compiler does not check the possible errors as I would like, ie : - I declared main() as returning a void, and the compiler did not complain. - I declared a function returning an int, and I do not use return statement in the function body. Again, the compiler does not complain. - I use a function without declaring the prototype. The compiler says nothing. Oct 05 2002
Yes, I have the latest available. bw <bw_member pathlink.com> wrote in news:annuff$24fi$1 digitaldaemon.com:In article <ann7mi$1cj9$1 digitaldaemon.com>, SD says...However, the compiler does not check the possible errors as I would like, ie : - I declared main() as returning a void, and the compiler did not complain. - I declared a function returning an int, and I do not use return statement in the function body. Again, the compiler does not complain. - I use a function without declaring the prototype. The compiler says nothing. Oct 06 2002
In article <anosh8$ke$1 digitaldaemon.com>, SD says...Yes, I have the latest available.got version 8.29 ? Oct 06 2002
'main' is required to be treated by compilers as a special function (to not break old code), and thus only for 'main' it is legal to declare it as 'void', declare it as int and not return a value. Remember, in older versions of C, a function without type declaration was treated as returning an int, and even then, it was ok for it to not return anything. afunction(){ ... } is in reality an 'int' function. These topics have been widely discussed in C computer magazines and I recollect have been elucidated in the ARM (Annotated Reference Manual), the standard which talks about C/C++. - Rajiv "bw" <bw_member pathlink.com> wrote in message news:anpfnv$ikk$1 digitaldaemon.com...In article <anosh8$ke$1 digitaldaemon.com>, SD says...Yes, I have the latest available.got version 8.29 ? Oct 07 2002
Hi OK, that's fine now. I think the -cpp flag made the difference. Mny thanks Stephane bw <bw_member pathlink.com> wrote in news:anpfnv$ikk$1 digitaldaemon.com:In article <anosh8$ke$1 digitaldaemon.com>, SD says...Yes, I have the latest available.got version 8.29 ? Oct 08 2002
|