Re: Unused bindings
Thanks, this is a known shortcoming. We'll either fix the docs or the implementation! --Sigbjorn Sven Panne writes: > GHC-3.01 can generate some really useful warnings, but some of those > generated by -fwarn-unused-binds (which is switched on via -Wall, too) > are plainly wrong. Silly, but short example: > .. > -- Foo.hs -- > module Foo(Bar(..)) where > > data Bar = MkBar > > instance Show Bar where >showsPrec _ = baz > > baz :: Bar -> ShowS > baz MkBar = showString "MkBar" > --- > >panne@liesl:> ghc -fwarn-unused-binds -c Foo.hs > >Foo.hs:9: Warning: `baz' is bound but not used > >ghc: module version changed to 1; reason: no old .hi file > > GHC doesn't seem to take instance declarations into account when > complaining... :-( >
Unused bindings
GHC-3.01 can generate some really useful warnings, but some of those generated by -fwarn-unused-binds (which is switched on via -Wall, too) are plainly wrong. Silly, but short example: -- Foo.hs -- module Foo(Bar(..)) where data Bar = MkBar instance Show Bar where showsPrec _ = baz baz :: Bar -> ShowS baz MkBar = showString "MkBar" --- panne@liesl:> ghc -fwarn-unused-binds -c Foo.hs Foo.hs:9: Warning: `baz' is bound but not used ghc: module version changed to 1; reason: no old .hi file GHC doesn't seem to take instance declarations into account when complaining... :-( -- Sven PanneTel.: +49/89/2178-2235 LMU, Institut fuer Informatik FAX : +49/89/2178-2211 LFE Programmier- und Modellierungssprachen Oettingenstr. 67 mailto:[EMAIL PROTECTED]D-80538 Muenchen http://www.pms.informatik.uni-muenchen.de/mitarbeiter/panne
Re: (long msg - includes source): Re: Defeated by profiling ....
Kevin GLYNN wrote: > [...] > (except: can someone explain how I set the profiling sampling interval. > The ghc user manual says that you use option -i where the argument > is in seconds (that can't be right, unless you allow fractions), can actually be a fraction of a second, e.g. -i0.08 for an interval of 80ms. > but the default seems to be 20ms and I don't seem to be able to change it). The default interval is 1 second and the *resolution* for changing the interval is 20ms (see fptools/ghc/includes/CostCentre.lh). -- Sven PanneTel.: +49/89/2178-2235 LMU, Institut fuer Informatik FAX : +49/89/2178-2211 LFE Programmier- und Modellierungssprachen Oettingenstr. 67 mailto:[EMAIL PROTECTED]D-80538 Muenchen http://www.pms.informatik.uni-muenchen.de/mitarbeiter/panne
Re: (long msg - includes source): Re: Defeated by profiling ....
> "Simon" == Simon Marlow <[EMAIL PROTECTED]> writes: Simon> Kevin GLYNN <[EMAIL PROTECTED]> writes: >> I realise that some time ago one of the ghc lists said that >> 'anyone who compiles a happy output file with optimisation flags >> set has cold semolina for brains' (or words to that effect). Simon> I believe it was porridge - we're in Scotland here :-) OK, you've got me! I was born a little to the South, and now live a lot to the South ... Anyway, thanks to Sven (and -Onot) I think I now have everything I need (except: can someone explain how I set the profiling sampling interval. The ghc user manual says that you use option -i where the argument is in seconds (that can't be right, unless you allow fractions), but the default seems to be 20ms and I don't seem to be able to change it). Apologies for missing the earlier messages, I did have a quick scan of the archive, but it is Friday ... thanks again, k -- wot, no .sig?
Re: (long msg - includes source): Re: Defeated by profiling ....
Kevin GLYNN <[EMAIL PROTECTED]> writes: > I realise that some time ago one of the ghc lists said that 'anyone who > compiles a happy output file with optimisation flags set has cold > semolina for brains' (or words to that effect). I believe it was porridge - we're in Scotland here :-) > However, if I compile > the hs file produced from the following happy file with a -O flag ghc > will bust whatever heap size I give it, works OK without the > optimisation flag. This is most likely due to the strictness analyser or the update analyser being confused by the recursive HappyState type in the generated grammar. It's a known bug in both of these abstract interpreters. There simply isn't any useful optimisation to do in Happy grammar files, which is why we recommend not using -O (and because it tickles these bugs of course...). Cheers, Simon -- Simon Marlow [EMAIL PROTECTED] University of Glasgow http://www.dcs.gla.ac.uk/~simonm/ finger for PGP public key
Re: (long msg - includes source): Re: Defeated by profiling ....
Kevin GLYNN wrote: > [...] > ObBug2 > -- > I want to run gmake install (necessary with the library > re-organisations!). I get the following error: > > [keving@holly] kgbuild [52] make uninstall > /bin/sh: syntax error at line 1: `;' unexpected > [...] > This is a classic one: http://www.dcs.gla.ac.uk/mail-www/glasgow-haskell-bugs/msg00785.html > ObBug3 > -- > > hstags is missing a semi-colon from the end of line 70. > This one is known, too: http://www.dcs.gla.ac.uk/mail-www/glasgow-haskell-bugs/msg00972.html Shortly after the release of 3.01 there was a phase of wild Patch-O-mania, so it was easy to miss some of the bug fixes. > ObBug4 > -- > [...] I don't need an optimised parser, but my cold > semolina can't be bothered working out how to write a Makefile that > passes different options to one file than all the others I guess that your makefile uses pattern rules like this: %.o: %.hs $(RM) $@ $(HC) $(HCFLAGS) -c $< -o $@ with HCFLAGS probably containing -O. You can override this by an explicit rule for your parser, stating that it should be compiled without optimisations: Parser.o: Parser.hs $(RM) $@ $(HC) $(HCFLAGS) -Onot -c $< -o $@ Hope this helps. -- Sven PanneTel.: +49/89/2178-2235 LMU, Institut fuer Informatik FAX : +49/89/2178-2211 LFE Programmier- und Modellierungssprachen Oettingenstr. 67 mailto:[EMAIL PROTECTED]D-80538 Muenchen http://www.pms.informatik.uni-muenchen.de/mitarbeiter/panne
(long msg - includes source): Re: Defeated by profiling ....
> "Sigbjorn" == Sigbjorn Finne <[EMAIL PROTECTED]> writes: Sigbjorn> Hi, Sigbjorn> you don't say what version you're using, but I'm guessing Sigbjorn> it's 3.01. There'a a couple of patches that should fix Sigbjorn> the problem of cross-module scc inlinings for 3.01 - Sigbjorn> appended at the end. Sigbjorn> Pls let us know if this doesn't fix things. Sigbjorn> --Sigbjorn Thanks your patch worked great. Now, I've got lots of numbers to look at which should keep me quiet for a bit, except for the following ObBugs (all from ghc-3.01 on solaris): ObBug1 -- gmake install can't remove the existing ghc symbolic link before re-creating. ObBug2 -- I want to run gmake install (necessary with the library re-organisations!). I get the following error: [keving@holly] kgbuild [52] make uninstall /bin/sh: syntax error at line 1: `;' unexpected make: *** [uninstall] Error 2 [keving@holly] kgbuild [53] If I run gmake -d uninstall I am little wiser: [keving@holly] kgbuild [55] gmake -d uninstall GNU Make version 3.72.1, by Richard Stallman and Roland McGrath. Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Reading makefiles... Reading makefile `Makefile'... Reading makefile `mk/boilerplate.mk' (search path) (no ~ expansion)... Reading makefile `mk/config.mk' (search path) (no ~ expansion)... Reading makefile `mk/paths.mk' (search path) (no ~ expansion)... Reading makefile `mk/opts.mk' (search path) (no ~ expansion)... Reading makefile `mk/suffix.mk' (search path) (no ~ expansion)... Reading makefile `mk/build.mk' (search path) (don't care) (no ~ expansion)... Reading makefile `.depend' (search path) (don't care) (no ~ expansion)... Reading makefile `mk/target.mk' (search path) (no ~ expansion)... Child access: user 1011 (real 1011), group 22 (real 22) Got a SIGCHLD; 1 unreaped children. Child access: user 1011 (real 1011), group 22 (real 22) Child access: user 1011 (real 1011), group 22 (real 22) Updating makefiles Considering target file `mk/target.mk'. Looking for an implicit rule for `mk/target.mk'. No implicit rule found for `mk/target.mk'. Finished dependencies of target file `mk/target.mk'. No need to remake target `mk/target.mk'. Considering target file `.depend'. Looking for an implicit rule for `.depend'. No implicit rule found for `.depend'. Finished dependencies of target file `.depend'. No need to remake target `.depend'. Considering target file `mk/build.mk'. Looking for an implicit rule for `mk/build.mk'. No implicit rule found for `mk/build.mk'. Finished dependencies of target file `mk/build.mk'. No need to remake target `mk/build.mk'. Considering target file `mk/suffix.mk'. Looking for an implicit rule for `mk/suffix.mk'. No implicit rule found for `mk/suffix.mk'. Finished dependencies of target file `mk/suffix.mk'. No need to remake target `mk/suffix.mk'. Considering target file `mk/opts.mk'. Looking for an implicit rule for `mk/opts.mk'. No implicit rule found for `mk/opts.mk'. Finished dependencies of target file `mk/opts.mk'. No need to remake target `mk/opts.mk'. Considering target file `mk/paths.mk'. Looking for an implicit rule for `mk/paths.mk'. No implicit rule found for `mk/paths.mk'. Finished dependencies of target file `mk/paths.mk'. No need to remake target `mk/paths.mk'. Considering target file `mk/config.mk'. Looking for an implicit rule for `mk/config.mk'. No implicit rule found for `mk/config.mk'. Finished dependencies of target file `mk/config.mk'. No need to remake target `mk/config.mk'. Considering target file `mk/boilerplate.mk'. Looking for an implicit rule for `mk/boilerplate.mk'. No implicit rule found for `mk/boilerplate.mk'. Finished dependencies of target file `mk/boilerplate.mk'. No need to remake target `mk/boilerplate.mk'. Considering target file `Makefile'. Looking for an implicit rule for `Makefile'. No implicit rule found for `Makefile'. Finished dependencies of target file `Makefile'. No need to remake target `Makefile'. Updating goal targets Considering target file `uninstall'. File `uninstall' does not exist. Finished dependencies of target file `uninstall'. Target `uninstall' is double-colon and has no dependencies. Must remake target `uninstall'. Child access: user 1011 (real 1011), group 22 (real 22) /bin/sh: syntax error at line 1: `;' unexpected Putting child 0x00068730 PID 12129 on the chain. Live child 0x00068730 PID 12129 Reaping losing child 0x00068730 PID 12129 gmake: *** [uninstall] Error 2 Removing child 0x00068730 PID 12129 from chain. [keving@holly] kgbuild [56] ObBug3 -- hstags is missing a semi-colon from the end of line 70. ObBug4 -- I realise that some time ago one of the ghc lists said that 'anyone who compiles a happy output f