Re: clang warnings with unregisterised

2014-08-28 Thread Sergei Trofimovich
On Fri, 29 Aug 2014 02:56:01 +0200
Gabor Greif  wrote:

> Devs,
> 
> I have built an UNREGISTERISED GHC, and the C-compiler used behind the
> scenes is clang. Now I get literally millions of warnings of the below
> kind:
> 
> 
> +/var/folders/k9/fj_1d5h17m7c4gbyp2srqrhmgq/T/ghc11601_0/ghc11601_4.hc:688:1:
> + warning: attribute declaration must precede definition
> [-Wignored-attributes]
> +II_(s4Vv_closure);
> +^
> +
> +/Users/ggreif/ghc-head/includes/Stg.h:213:63:
> + note: expanded from macro 'II_'
> +#define II_(X)  static StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
> +  ^
> +
> +/Users/ggreif/ghc-head/includes/Stg.h:175:42:
> + note: expanded from macro 'GNU_ATTRIBUTE'
> +#define GNU_ATTRIBUTE(at) __attribute__((at))
> + ^
> +
> +/var/folders/k9/fj_1d5h17m7c4gbyp2srqrhmgq/T/ghc11601_0/ghc11601_4.hc:588:16:
> + note: previous definition is here
> +static StgWord s4Vv_closure[] = {
> +   ^
> 
> It seems like the "II_" and "EI_" prototypes *follow* the real thing,
> and because clang is more picky with attribute placement, we get all
> those warnings.

They just occur many times in the source, thus not only before but also after
definition.

> compiler/cmm/PprC.hs:pprExternDecl is the function that puts together
> the "II_(...)" and "EI_(...)", but where does the "static StgWord
> s4Vv_closure[] = {" come from?

pprWordArray :: CLabel -> [CmmStatic] -> SDoc

> I just want to flip the order of their occurrence.

I think it would be a good thing to split .hc file lifting
all external and local declarations up (and print only
unique ones). It should shrink .hc file size a bit and
make it nicer to read.

-- 

  Sergei


signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs


clang warnings with unregisterised

2014-08-28 Thread Gabor Greif
Devs,

I have built an UNREGISTERISED GHC, and the C-compiler used behind the
scenes is clang. Now I get literally millions of warnings of the below
kind:


+/var/folders/k9/fj_1d5h17m7c4gbyp2srqrhmgq/T/ghc11601_0/ghc11601_4.hc:688:1:
+ warning: attribute declaration must precede definition
[-Wignored-attributes]
+II_(s4Vv_closure);
+^
+
+/Users/ggreif/ghc-head/includes/Stg.h:213:63:
+ note: expanded from macro 'II_'
+#define II_(X)  static StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
+  ^
+
+/Users/ggreif/ghc-head/includes/Stg.h:175:42:
+ note: expanded from macro 'GNU_ATTRIBUTE'
+#define GNU_ATTRIBUTE(at) __attribute__((at))
+ ^
+
+/var/folders/k9/fj_1d5h17m7c4gbyp2srqrhmgq/T/ghc11601_0/ghc11601_4.hc:588:16:
+ note: previous definition is here
+static StgWord s4Vv_closure[] = {
+   ^

It seems like the "II_" and "EI_" prototypes *follow* the real thing,
and because clang is more picky with attribute placement, we get all
those warnings.


compiler/cmm/PprC.hs:pprExternDecl is the function that puts together
the "II_(...)" and "EI_(...)", but where does the "static StgWord
s4Vv_closure[] = {" come from?

I just want to flip the order of their occurrence.

Thanks,

Gabor
___
ghc-devs mailing list
ghc-devs@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs