Hello,
On Monday 17 September 2007 14:41, Ian Lynagh wrote:
> ...
> So just to check, you can reproduce the failure with the ghc -Werror
> commandline, and if you remove -Werror then it works?
Exactly: With -Werror, the warnings are reported, the exit status is 1, and no
code is generated:
> $ /usr/bin/ghc -Werror -H64m -Onot -fasm -istage1/utils
-istage1/basicTypes -istage1/types -istage1/hsSyn -istage1/prelude
-istage1/rename -istage1/typecheck -istage1/deSugar -istage1/coreSyn
-istage1/vectorise -istage1/specialise -istage1/simplCore -istage1/stranal
-istage1/stgSyn -istage1/simplStg -istage1/codeGen -istage1/main
-istage1/profiling -istage1/parser -istage1/cprAnalysis
-istage1/ndpFlatten -istage1/iface -istage1/cmm -istage1/nativeGen -Wall
-fno-warn-name-shadowing -Istage1 -cpp -fglasgow-exts -fno-generics
-Rghc-timing -I. -Iparser -package unix -recomp -Rghc-timing -O -fasm -H16M
'-#include "cutils.h"' -DUSING_COMPAT -i../compat -package unix -O -c
utils/Encoding.hs -o stage1/utils/Encoding.o -ohi stage1/utils/Encoding.hi
>
> utils/Encoding.hs:144: Warning: Defined but not used: c
>
> utils/Encoding.hs:146:
> Warning: Definition but no type signature for `unPtr'
>
> utils/Encoding.hs:176: Warning: Defined but not used: ptr
>
> utils/Encoding.hs:338:
> Warning: Definition but no type signature for `decode_num_esc'
>
> utils/Encoding.hs:374: Warning: Defined but not used: cs
>
> utils/Encoding.hs:375: Warning: Defined but not used: other
>
> utils/Encoding.hs:378: Warning: Defined but not used: cs
>
> utils/Encoding.hs:379: Warning: Defined but not used: other
>
> utils/Encoding.hs:380: Warning: Defined but not used: other
> <<ghc: 24819716 bytes, 6 GCs, 56312/56312 avg/max bytes residency (1
samples), 16M in use, 0.00 INIT (0.00 elapsed), 0.10 MUT (0.69 elapsed), 0.01
GC (0.20 elapsed) :ghc>>
> $ echo $?
> 1
> $ ls stage1/utils/Encoding.*
> /bin/ls: stage1/utils/Encoding.*: No such file or directory
> $
Whereas without the -Werror, warnings are still reported, but the exit status
is 0 and code is generated:
> $ /usr/bin/ghc -H64m -Onot -fasm -istage1/utils -istage1/basicTypes
-istage1/types -istage1/hsSyn -istage1/prelude -istage1/rename
-istage1/typecheck -istage1/deSugar -istage1/coreSyn -istage1/vectorise
-istage1/specialise -istage1/simplCore -istage1/stranal -istage1/stgSyn
-istage1/simplStg -istage1/codeGen -istage1/main -istage1/profiling
-istage1/parser -istage1/cprAnalysis -istage1/ndpFlatten -istage1/iface
-istage1/cmm -istage1/nativeGen -Wall -fno-warn-name-shadowing -Istage1 -cpp
-fglasgow-exts -fno-generics -Rghc-timing -I. -Iparser -package unix -recomp
-Rghc-timing -O -fasm -H16M '-#include "cutils.h"' -DUSING_COMPAT -i../compat
-package unix -O -c utils/Encoding.hs -o stage1/utils/Encoding.o -ohi
stage1/utils/Encoding.hi
>
> utils/Encoding.hs:144: Warning: Defined but not used: c
>
> utils/Encoding.hs:146:
> Warning: Definition but no type signature for `unPtr'
>
> utils/Encoding.hs:176: Warning: Defined but not used: ptr
>
> utils/Encoding.hs:338:
> Warning: Definition but no type signature for `decode_num_esc'
>
> utils/Encoding.hs:374: Warning: Defined but not used: cs
>
> utils/Encoding.hs:375: Warning: Defined but not used: other
>
> utils/Encoding.hs:378: Warning: Defined but not used: cs
>
> utils/Encoding.hs:379: Warning: Defined but not used: other
>
> utils/Encoding.hs:380: Warning: Defined but not used: other
> <<ghc: 189025708 bytes, 29 GCs, 2734311/5744244 avg/max bytes residency (4
samples), 20M in use, 0.00 INIT (0.00 elapsed), 1.02 MUT (14.73 elapsed),
0.26 GC (0.30 elapsed) :ghc>>
> $ echo $?
> 0
> $ ls stage1/utils/Encoding.*
> stage1/utils/Encoding.hi stage1/utils/Encoding.o
> $
>
> You have "{-# OPTIONS -w #-}" in compiler/utils/Encoding.hs, right?
Yes.
> If you move that to the very first line, i.e. above the comments, does
> that fix it?
Yes, it does. Putting the {-# OPTIONS -w #-} on the first line eliminates the
warnings and, hence, the exit status of 1 when -Werror is set.
> If not, does putting it on the end of the commandline fix
> it?
That fixes the problem too.
> ...
Thanks and best regards
Thorkil
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc