Skip to content

Include directive on first line produces invalid Haskell source #16

Closed
@ian-ross

Description

@ian-ross

Bug imported from C2HS Trac

Trac ticket created: 2009-03-14T17:47:58-0700


Example:

Foo.chs (exactly one newline in the file, at the end):

#include "foo.h"

foo.h is empty. Run "c2hs Foo.chs". Foo.hs will contain this as the last line:

{-# LINE 1 "Foo.chs" #-}#include "foo.h"

Upon compilation, ghc chokes with:

Foo.chs" #-}#include "foo.h:0:30: lexical error at character '\n'

Problem is fixed by adding one extra newline before the include, or moving the include to some other place than at the very beginning of the file. Unexpected behavior anyway. c2hs version 0.16.0 on x86 Linux. I think it was present in older versions also, though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions