Skip to content

Commit

Permalink
UNREG: add a forward declaration for local literals
Browse files Browse the repository at this point in the history
When toplevel literals don't have a way to be exported
from module GHC infers their labels as static.

Example from GHC.Arr:
    static char rdVA_bytes[] = " out of range ";

When this label is used in module internally
we also need to provide it's forward declaration.

Signed-off-by: Sergei Trofimovich <[email protected]>
  • Loading branch information
trofi committed Jan 29, 2017
1 parent 34a0205 commit 4441f90
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions includes/Stg.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ typedef StgWord StgWordArray[];
typedef StgFunPtr F_;

#define EB_(X) extern char X[]
#define IB_(X) static char X[]
#define EI_(X) extern StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
#define II_(X) static StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
#define IF_(f) static StgFunPtr GNUC3_ATTRIBUTE(used) f(void)
Expand Down

0 comments on commit 4441f90

Please sign in to comment.