Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Auto format (arduino formatter) breaks this line in #define #2072

Open
Assignees
@littlegreenrock

Description

1st: apologies, as I am too novice to be able to identify what this is called. Because of the esoteric nature of this line of code, this issue couldn't possibly be affecting ... well... maybe anyone more than myself. Further, anyone who would use such a line would know how to work around it. The question is more: "how does this line of code get interpreted, and what does it mean?" rather than "can you fix this bug?"

what should happen? Autoformat shouldn't remove the 'space', or move the asterisk.
Why is it doing this? it looks a lot like a reference asterisk, probably the compiler can't tell the difference. (i can't)
Repeatable? Yes, easily.
Workaround? Yes, with a tiny block quote
Impact and Urgency? Low, Low.

Example 1: here the line works as the block comment inhibits the interpreter from moving the asterisk.

#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper /*dumb*/ *>(pstr_pointer))

Example 2a: Here the line is entered as to compile, working,

#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))

Example 2b: ... after auto format the line is broken, will no longer compile.

#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper*>(pstr_pointer))

Metadata

Metadata

Assignees

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

      AltStyle によって変換されたページ (->オリジナル) /