Skip to content

Follow-up to #125: Null directive after define confuses simplecpp #126

Closed

Description

@versat

This C code:

# if 1
#  define a 1
#
# endif

int main()
{
    printf("%d", a);
}

results in this error:

$ ./simplecpp null_directive.c

null_directive.c:2: syntax error: failed to expand 'a', Invalid ## usage when expanding 'a'.

Somehow the single # in the line after a define maybe is appended (also with a second #?) to the define and thus results in this error.

boost uses such constructs, so it still does not fully work to parse the boost headers. But the fix from #125 already helps a lot.

Activity

  1. versat commented on Aug 20, 2019

    @versat
    ContributorAuthor

    Thanks for fixing this @diorcety, I did not notice that before.
    Closing this issue as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions