Ticket #2 (new defect)
Language.C fails doesn't support Mac OS X blocks notation
| Reported by: | ezyang | Owned by: | benedikt |
|---|---|---|---|
| Priority: | major | Milestone: | 0.4.0 |
| Component: | parser | Version: | 0.3.1.1 |
| Keywords: | Cc: | ezyang@… |
Description
This is causing Bug 29 for c2hs.
Steps to reproduce:
1. Get stdlib.h from Mac OS X 10.6 (Snow Leopard). I've attached the file from my machine here for convenience.
2. Attempt to parse the header file with the default GCC preprocessor as such:
Prelude Language.C Language.C.System.GCC> either show (show . pretty) `fmap` parseCFile (newGCC "gcc") Nothing [] "/usr/include/stdlib.h" "/usr/include/stdlib.h:272: (column 20) [ERROR] >>> Syntax Error ! Syntax error ! The symbol `^' does not fit here. "
Expected result: parse is successful, possibly just ignoring BLOCKS notation.
Here is the segment of the header file in question:
#ifdef __BLOCKS__
int atexit_b(void (^)(void));
void *bsearch_b(const void *, const void *, size_t,
size_t, int (^)(const void *, const void *));
#endif /* __BLOCKS__ */
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

