clang warnings with unregisterised

Sergei Trofimovich slyich at gmail.com
Fri Aug 29 05:45:07 UTC 2014


On Fri, 29 Aug 2014 02:56:01 +0200
Gabor Greif <ggreif at gmail.com> 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_1d5h17m7c4gbyp2srqrhm0000gq/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_1d5h17m7c4gbyp2srqrhm0000gq/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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20140829/c8d110d1/attachment.sig>


More information about the ghc-devs mailing list