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++ - Wrong warning (18)
Hello, The following code: int f () { throw 10; } int main () { return 0; } produces: Warning 18: implied return of f at closing '}' does not return value Can you please provide a way to disable warnings via #pragma's and push/pop these settings so that warnings are disabled only for some sections of the code ? I wouldn't like to turn off this warning for the entire code. (For example, with Borland, one can write: #pragma option push #pragma warn-par .. #pragma option pop ) Thanks, Adder Apr 06 2006
Adder wrote:Hello, The following code: int f () { throw 10; } int main () { return 0; } produces: Warning 18: implied return of f at closing '}' does not return value Can you please provide a way to disable warnings via #pragma's and push/pop these settings so that warnings are disabled only for some sections of the code ? I wouldn't like to turn off this warning for the entire code. (For example, with Borland, one can write: #pragma option push #pragma warn-par .. #pragma option pop ) Apr 06 2006
An easier way to turn off the warning is to rewrite as: int f() { throw 10; return 0; } Apr 06 2006
Adder wrote:An easier way to turn off the warning is to rewrite as: Apr 06 2006
|