Skip to content

transformation .ino to .cpp fails with multi-line macro definition #1971

@peabo7

Description

@peabo7

This code is not properly transformed from .ino to .cpp; the line containing "0" is erroneously emitted right after the #include "Arduino.h" statement resulting in a diagnostic such as:

buggy.ino:5: error: expected unqualified-id before numeric constant

Rewriting the macro "abc" so it fits on one line avoids the problem. Note also that the line number referenced in the error message is not the line number of the macro definition or the expansion, making it difficult to find what is wrong in a large program.

 #define abc \
 0

 void
 setup()
 {
   abc;
 }

 void
 loop()
 {
 }

I saw this using1.5.6-r2 BETA, but have not tested it on previous versions.

Peter Olson

Metadata

Metadata

Assignees

Labels

Component: PreprocessorThe Arduino sketch preprocessor converts .ino files into C++ code before compilation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy