[GHC] #9689: const_str support needed for hsc2hs in cross-compilation mode

GHC ghc-devs at haskell.org
Tue Oct 14 21:51:40 UTC 2014


#9689: const_str support needed for hsc2hs in cross-compilation mode
-------------------------------------+-------------------------------------
              Reporter:  aosivitz    |            Owner:
                  Type:  feature     |           Status:  new
  request                            |        Milestone:
              Priority:  normal      |          Version:  7.8.3
             Component:  hsc2hs      |         Keywords:  zlib ios cross-
            Resolution:              |  compilation
      Operating System:              |     Architecture:  arm
  Unknown/Multiple                   |       Difficulty:  Unknown
       Type of failure:  Other       |       Blocked By:
             Test Case:              |  Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 You can also get the length of a string with `sizeof`, but I don't think
 it's possible to extract the characters, at least not as far as anybody
 knows. The obvious attempts like `/* const char s[]; */ int x[s[0]];`
 don't work because `s[0]` is not considered a constant expression.

 IIRC I looked and didn't find a way to detect string constants when cross-
 compiling with autoconf either.

 For zlib in particular, I have a patch that avoids the need for string
 constants: http://lpaste.net/8287391336118616064

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9689#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list