RFC: Avoiding #warning (C/C++ preprocessor extension)
ogoffart at kde.org
Sun Oct 30 23:16:32 GMT 2005
Le Dimanche 30 Octobre 2005 21:25, Jarosław Staniek a écrit :
> Since KDE is becoming more portable, my proposal is to avoid using #warning
> C/C++ preprocessor's extension. Unlike #error, #warning is not a standard -
> several compilers in addition to gcc implement this. Msvc compiler does
All of this is correct.
Anyway, #warning are just temporary code, and they should be removed before
A good code compiles without warnings at all.
We should not simply remove the #warning line, but also fix the code.
> To find a solution I would propose to:
> 1. Preferred way: Using doxygen @todo tag instead of #warning. Then
> warnings can be accessible:
> 1.1. Within Doxygen docs (Related Pages->Todo list), eg.
>cs/kdecore/html/todo.html 1.2. By just grepping for @todo. This is no
> different to using #warnings because every #warning can quickly disappear
> from your screen during compilation, so you still need to find it in the
This is a bit different: @todo are placed in header, and not directly in the
code they show.
also #warning are generally used for more important things, while @todo may be
There is also a flag to make all warnings act like fatal error, to force to
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
More information about the kde-core-devel