Hi,
I enabled warnings in darcs.cabal, ran "cabal build 2>cabal.log", edited
the resulting file to keep only warnings related to issue1988 and then
ran the following script:
----------------------------------------------------------------------
#!/bin/sh
awk 'BEGIN { RS = "" ; FS = "\n" }
{s=$1;
i=2;
while(match($i,"Suppress")==0) { s=(s $i); i++}
gsub(/ +/," ",s);
print s}' < cabal.log | sort -ur |\
awk 'BEGIN { FS = ":" }
{
cur = $1 $2 $3
if(prev != cur) {
printf(":execute \"edit %s\"\n",$1)
printf(":execute \"normal %sG0%sli_ <- \\<Esc>\"\n",$2,$3)
printf(":execute \"normal O-- Warning: %s\\<Esc>\"\n",$5)
printf(":execute \"write %s\"\n",$1)
} else
{ printf("\" skipping %s:%s:%s\n", $1,$2,$3) }
prev = cur
}' > convert.vim
----------------------------------------------------------------------
It produces a vim script file, which I ran in the root of the darcs
repository, with ":source convert.vim".
The resulting patch is useful because it helps spotting warnings
introduced by future patches to darcs: even if it takes times to check
that the 163 silenced warnings of this patch are effectively harmless, we
can at least avoid adding new such warnings.
Best,
Gabriel
1 patch for repository http://darcs.net:
Fri Nov 5 10:29:33 CET 2010 Gabriel Kerneis <kerneis@pps.jussieu.fr>
* resolve issue1988: enable warn-unused-do-bind
This patch enables warn-unused-do-bind and silences the 163 warnings of
that kind spread accross darcs code.
Please note that that this patch has been automatically generated by a
shell script. It does not change or break anything, but might silence
warnings which are actual bugs.
Attachments
|