Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#7232 closed bug (wontfix)

make hsc2hs work with -c g++

Reported by: elaforge Owned by:
Priority: normal Milestone:
Component: hsc2hs Version: 7.6.1
Keywords: Cc: david@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Ticket #2897 changed hsc2hs to create a *_utils.c file containing stub functions for several libc functions. To avoid template-hsc.h having to include stdio.h, they use (void *) instead of (FILE *). C compilers will happily cast the void* to FILE*, but g++ is more picky. It's easily fixed by adding an explicit cast to FILE*.

Attachments (1)

hsc2hs.patch (839 bytes) - added by elaforge 3 years ago.

Download all attachments as: .zip

Change History (4)

Changed 3 years ago by elaforge


comment:1 Changed 3 years ago by igloo

  • difficulty set to Unknown
  • Resolution set to wontfix
  • Status changed from new to closed

We can't refer to FILE, unfortunately:

-- "void" should really be "FILE", but we aren't able to 
-- refer to "FILE" in template-hsc.h as we don't want to 
-- include <stdio.h> there 

comment:2 Changed 3 years ago by drpowell

  • Cc david@… added

I'd like to see this bug fixed.

I think the proposed patch is correct. It is the .h file that cannot refer to <stdio.h>. The _hsc_utils.c file *can*, and already does, refer to <stdio.h>. This patch just makes the implicit cast to FILE* explicit in _hsc_utils.c.

comment:3 Changed 3 years ago by igloo

Ah, sorry, you are right. I've applied the patch.

Note: See TracTickets for help on using tickets.