Skip to content

Comments at end of concatenation macro cause error #5079

Open
@jrt999

Description

@jrt999

A concatenation macro having a comment at end of same line causes Arduino IDE to fail - appears to be when it is "pasting" for indexing source code. CPP processes the file fine.

Example code

# define RXN 2  /* comment here causes error: pasting ... does not give valid preprocessing token */
# define RXN_BUFHEAD(X)        Rx ## X ## _BufHead
# define Rxn_BUFHEAD(X)        RXN_BUFHEAD(X)
# define Rxn_BufHead           Rxn_BUFHEAD(RXN)

static uint8_t   Rxn_BufHead;  // User read steps on, then takes from buffer

void setup() {

  Rx2_BufHead = 0;
}

void loop() {
}

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