[IPOL discuss] Software guidelines: C/C++ warnings

David Tschumperlé David.Tschumperle at ensicaen.fr
Tue Apr 3 18:29:28 CEST 2012


I don't think this is a good idea.
In some cases, you may get compilation warnings that are indeed just
"warnings" and which don't mean your code is incorrect.
One example : if you define a template function that tests the positivity
of a (template-typed) number, and instanciate it with template parameter
T=unsigned int. You will get a warning telling that 'assertion x>=0 is
always true'.
This is not a warning you cannot remove easily without doing nasty tricks
(doing template specializations for the 'unsigned int' typed function,
which means duplicating the function code for nothing else than removing a
warning).
There are in fact lot of tricky cases like this (try also to use 'setjmp',
as the libpng suggests for error handling, you will get some warnings too
!).

Also, from my experience with CImg, I notice that new warning messages
appear everytime when switching to new versions of gcc/g++. I'm trying to
remove them the most I can, because I'm still active in the project. I
don't think you can expect IPOL code submitters to do the same (will they
still maintain their submission in 10 years ?).

David.


2012/4/3 Miguel Colom <Miguel.Colom at cmla.ens-cachan.fr>

> Dear all,
> I've noticed that the IPOL software guidelines [1] don't tell explicitly
> anything about the compilation warnings.
>
> It's implicit at section 2.2, where it says "IPOL authors should test
> their C and C++ source code with the gcc compiler in strict compilation
> mode before submitting it to IPOL.".
>
> I think that it should say that the code *must* compile without any
> warning in the strict mode.
>
> Best,
> Miguel
>
> [1] http://tools.ipol.im/wiki/ref/software_guidelines/
>
> _______________________________________________
> discuss mailing list
> discuss at list.ipol.im
> http://tools.ipol.im/mailman/listinfo/discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tools.ipol.im/mailman/archive/discuss/attachments/20120403/2a8cdbd7/attachment.html>


More information about the discuss mailing list