2009/1/7 pgeorges <[email protected]>

> Mikhail Kalenkov a écrit :
> > Hello all,
> >
> > During scid build my compiler (gcc version 4.3.2 20081105 (Red Hat
> > 4.3.2-7)) emits a lot of (annoying?) warnings. Full build log can be
> > downloaded from http://katrine.lpi.ru/kalenkov/scid-3.7beta3-build.log
> > . I have written a simple patch that get rid most of them
> > http://katrine.lpi.ru/kalenkov/scid-warnmore 
> > correct.patch<http://katrine.lpi.ru/kalenkov/scid-warn.patch>
> > Perhaps it will be useful. I am not a programmer, so please review my
> > patch very carefully or simply discard it.
> >
> > Mikhail Kalenkov.
> Please check latest CVS, I already commited some fixes for warnings.
>
> Pascal

Indeed :) . Actually I think that my fixes are more correct. For instance in
tkscid.cpp you replaced

char * flagName = NULL;
flagName = "WhiteOpFlag";

by

char * flagName = NULL;
<http://scid.cvs.sourceforge.net/viewvc/scid/scid/src/tkscid.cpp?annotate=1.27#l6806>
flagName = (char *) "WhiteOpFlag";

I guess that it is not safe because flagName point to read only string
literal. But this fact doesn't shown explicitly in flagName declaration.
That's why I proposed in my patch to rewrite that piece of code as

const char * flagName = NULL;
flagName = "WhiteOpFlag";

Mikhail Kalenkov.

PS In my patch I never used (char *) casting because of mentioned
above argument.
------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Scid-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scid-users

Reply via email to