Opened 20 months ago

Closed 18 months ago

Last modified 18 months 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 Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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 20 months ago.
patch

Download all attachments as: .zip

Change History (4)

Changed 20 months ago by elaforge

patch

comment:1 Changed 18 months 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 18 months 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 18 months ago by igloo

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

Note: See TracTickets for help on using tickets.