[GHC] #12849: hsc2hs trouble with floating-point constants in cross-compilation mode

GHC ghc-devs at haskell.org
Thu Nov 17 20:31:59 UTC 2016


#12849: hsc2hs trouble with floating-point constants in cross-compilation mode
-------------------------------------+-------------------------------------
           Reporter:  rwbarton       |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  hsc2hs         |           Version:  7.8.4
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Split off from #7983.

 GCC 4.6 rejects some uses of floating-point constants in the declaration
 of a local static array. From ticket:7983#comment:5:

 > This is caused by a regression in GCC from gcc-4.4 to gcc-4.6:
 ​https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46028
 >
 > {{{
 > $ cat Test_hsc_test0.c
 > void _hsc2hs_test1()
 > {
 >     static int test_array[(89.) > 0 ? 2 : 1];
 > }
 >
 > $ /usr/bin/gcc-4.4 -c ./Test_hsc_test0.c
 >
 > $ /usr/bin/gcc-4.6 -c ./Test_hsc_test0.c
 > ./Test_hsc_test0.c: In function ‘_hsc2hs_test1’:
 > ./Test_hsc_test0.c:3:16: error: storage size of ‘test_array’ isn’t
 constant
 > }}}

 This means that (if your C compiler is affected by this issue) hsc2hs
 can't handle
 {{{
 (#const 89.)
 }}}
 in cross-compilation mode.

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


More information about the ghc-tickets mailing list