Skip to content

Source modifications lead to compile failures #2755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
supuflounder opened this issue Mar 11, 2015 · 5 comments
Closed

Source modifications lead to compile failures #2755

supuflounder opened this issue Mar 11, 2015 · 5 comments
Assignees
Labels
Component: Preprocessor The Arduino sketch preprocessor converts .ino files into C++ code before compilation
Milestone

Comments

@supuflounder
Copy link

I have several times gotten compilation errors compiling perfectly valid C++ code. I am told that this is because the IDE, to simplify life for newbies, does all kinds of stuff to my source before sending it to the compiler.

I want an "expert mode" that says "hands off my code" and avoids the transformations that create erroneous programs out of correct programs

@ryanneve
Copy link

You may want to look into using Atmel Studio instead of the Arduino IDE. Look into Visual Micro as well. A huge step up from the basic IDE. Unfortunately, I believe these are both windows only.

@ffissore
Copy link
Contributor

@supuflounder you can avoid the IDE magic by adding .h and .cpp "tabs" (files) to your sketch. They won't be preprocessed
If you want to help us improve the IDE preprocessor, please give a spin to the IDE linked at the bottom of this page #2729. It solves all the preprocessor related issue reported so far

@ffissore ffissore added the Component: Preprocessor The Arduino sketch preprocessor converts .ino files into C++ code before compilation label Mar 12, 2015
@ffissore ffissore self-assigned this Mar 12, 2015
@supuflounder
Copy link
Author

Thank you, I will try it within the next few days.
Joe

@supuflounder you can avoid the IDE magic by adding .h and .cpp "tabs"
(files) to your sketch. They won't be preprocessed
If you want to help us improve the IDE preprocessor, please give a spin to
the IDE linked at the bottom of this page
#2729. It solves all the
preprocessor related issue reported so far


Reply to this email directly or view it on GitHub:
#2755 (comment)

@supuflounder
Copy link
Author

Well, it doesn't work. I get a null pointer exception in the preprocessor module (see below)
[code]
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/coan source -m -E -P -kb -DF_CPU=16000000L -DARDUINO=10602 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR /var/folders/qk/48tgmmgj3bq6x7_r2cxw_20w0000gn/T/sketch9131219889757286104.cpp
Using library Adafruit_NeoPixel in folder: /Users/flounder/Documents/Arduino/libraries/Adafruit_NeoPixel (legacy)
Using library colorref4 in folder: /Users/flounder/Documents/Arduino/libraries/colorref4 (legacy)
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzn /var/folders/qk/48tgmmgj3bq6x7_r2cxw_20w0000gn/T/sketch5858252572529864852.cpp
processing.app.debug.RunnerException
at processing.app.debug.Compiler.compile(Compiler.java:359)
at processing.app.debug.Compiler.build(Compiler.java:98)
at processing.app.Sketch.build(Sketch.java:1169)
at processing.app.Sketch.build(Sketch.java:1142)
at processing.app.Editor$BuildHandler.run(Editor.java:1979)
at java.lang.Thread.run(Thread.java:695)
Caused by: java.lang.NullPointerException
at processing.app.preproc.CTagsParser.addPrototypes(CTagsParser.java:94)
at processing.app.preproc.CTagsParser.preprocess(CTagsParser.java:38)
at processing.app.preproc.CTagsBakedPreprocessor.parseCTagsOutput(CTagsBakedPreprocessor.java:113)
at processing.app.preproc.CTagsBakedPreprocessor.preprocess(CTagsBakedPreprocessor.java:52)
at processing.app.preproc.CTagsBakedPreprocessor.preprocess(CTagsBakedPreprocessor.java:42)
at processing.app.debug.Compiler.compile(Compiler.java:357)
... 5 more
[/code]

If you already know about this, then I'll wait for the fix; if not, I can send you the source code that causes the problem (contact me as [email protected]).

@ffissore
Copy link
Contributor

Fixed by #3779

@ffissore ffissore added this to the Release 1.6.6 milestone Sep 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Preprocessor The Arduino sketch preprocessor converts .ino files into C++ code before compilation
Projects
None yet
Development

No branches or pull requests

3 participants