
I am sorry, indeed, ghc-6.12.1 warns of Unrecognised pragma on {-# "foo" #-}. I have just missed this warning. The next question is: why it is a warning and not an error break? ----------------- Serge Mechveliani mechvel@botik.ru On Sun, Feb 07, 2010 at 10:56:53AM +0000, Ian Lynagh wrote:
On Sun, Feb 07, 2010 at 11:39:31AM +0300, Serge D. Mechveliani wrote:
On Sat, Feb 06, 2010 at 08:24:07PM +0000, Ian Lynagh wrote:
On Sun, Jan 31, 2010 at 10:09:42PM +0300, Serge D. Mechveliani wrote:
I have a suggestion: is it better for GHC to report an error on the source of kind {-# "foo" #-} (entered by a typo instead of {-# SCC "foo" #-}) ? Currently, GHC makes the program under (-prof) in which, the "foo" center occurs skipped. This misleads the user: "foo is not in the profiling head, so it takes zero cost".
6.12.1 will warn:
q.hs:3:0: Unrecognised pragma
by default.
May be, you mean the version next to 6.12.1 ? Because this my report is exactly on 6.12.1.
No, in 6.12.1:
$ cat Q.hs
module Q where
{-# "foo" #-}
$ ghci Q.hs GHCi, version 6.12.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. [1 of 1] Compiling Q ( Q.hs, interpreted )
Q.hs:4:0: Unrecognised pragma Ok, modules loaded: Q. *Q>
Thanks Ian

Am Sonntag 07 Februar 2010 13:06:14 schrieb Serge D. Mechveliani:
I am sorry, indeed, ghc-6.12.1 warns of Unrecognised pragma on {-# "foo" #-}. I have just missed this warning.
The next question is: why it is a warning and not an error break?
Because it might be a valid pragma for some other implementation, so erroring on unrecognised pragmas is not a good option. It would be nice if there was a commandline switch -ferror-unrecognised-pragmas (similarly for other warnings, -ferror-incomplete-patterns, ...), but if your code is otherwise clean enough, something like -Wall -Werror -fno-warn-type-defaults -fno-warn-simple-patterns is convenient, too.

On Sun, Feb 07, 2010 at 01:22:07PM +0100, Daniel Fischer wrote:
Am Sonntag 07 Februar 2010 13:06:14 schrieb Serge D. Mechveliani:
I am sorry, indeed, ghc-6.12.1 warns of Unrecognised pragma on {-# "foo" #-}. I have just missed this warning.
The next question is: why it is a warning and not an error break?
Because it might be a valid pragma for some other implementation, so erroring on unrecognised pragmas is not a good option. [..]
Some of earlier implementations or only future? Do you expect for future to appear a pragma without its keyword? ----------------- Serge Mechveliani mechvel@botik.ru

Am Sonntag 07 Februar 2010 14:05:48 schrieb Serge D. Mechveliani:
On Sun, Feb 07, 2010 at 01:22:07PM +0100, Daniel Fischer wrote:
Am Sonntag 07 Februar 2010 13:06:14 schrieb Serge D. Mechveliani:
I am sorry, indeed, ghc-6.12.1 warns of Unrecognised pragma on {-# "foo" #-}. I have just missed this warning.
The next question is: why it is a warning and not an error break?
Because it might be a valid pragma for some other implementation, so erroring on unrecognised pragmas is not a good option. [..]
Some of earlier implementations or only future?
I know of no implementation that used {-# "string" #-} as a pragma, so future.
Do you expect for future to appear a pragma without its keyword?
No. But you can't be sure, can you?
----------------- Serge Mechveliani mechvel@botik.ru

On Sun, Feb 07, 2010 at 02:16:11PM +0100, Daniel Fischer wrote:
Am Sonntag 07 Februar 2010 14:05:48 schrieb Serge D. Mechveliani:
On Sun, Feb 07, 2010 at 01:22:07PM +0100, Daniel Fischer wrote:
Am Sonntag 07 Februar 2010 13:06:14 schrieb Serge D. Mechveliani:
I am sorry, indeed, ghc-6.12.1 warns of Unrecognised pragma on {-# "foo" #-}. I have just missed this warning.
The next question is: why it is a warning and not an error break?
Because it might be a valid pragma for some other implementation, so erroring on unrecognised pragmas is not a good option. [..]
Some of earlier implementations or only future?
I know of no implementation that used {-# "string" #-} as a pragma, so future.
Do you expect for future to appear a pragma without its keyword?
No. But you can't be sure, can you?
My idea and suggestion is: if the GHC developers take for future that each pragma must have its keyword, then this will prevent some user errors. And the question is: what might be the drawback, I wonder. ----------------- Serge Mechveliani mechvel@botik.ru
participants (2)
-
Daniel Fischer
-
Serge D. Mechveliani