Opened 5 years ago

Closed 5 years ago

Last modified 5 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 5 years ago.

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by elaforge

Attachment: hsc2hs.patch added


comment:1 Changed 5 years ago by igloo

difficulty: Unknown
Resolution: wontfix
Status: newclosed

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 5 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 5 years ago by igloo

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

Note: See TracTickets for help on using tickets.