Skip to content

-D and -U options processed in the wrong order. #105

@mrolle45

Description

@mrolle45

PCPP handles all the -U options after all the -D options. However, GCC handles them all in the order found on the command line.
Example:

File b.c:
FOO
gcc -E -D FOO=1 -U FOO -D FOO=2 b.c produces
# 0 "b.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "b.c"
2
pcpp -D FOO=1 -U FOO -D FOO=2 b.c produces
#line 1 "b.c"
FOO

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions