Love UECIDE? Why not consider supporting the development?

User registrations are now disabled on this site.

We have a new forum system

>> Click here to try it out. <<

amazing warnings for arduino compilation

amazing warnings for arduino compilation

Postby Achille » Fri Jan 30, 2015 6:43 pm

Hi matt
Could you please explain these 2 kinds of warnings (compilating for arduino mega/avr-gcc in uecide-0.8.7z34-macosx):
1) 620: const String ipServerLocal="http://192.168.1.18";
included in header part gives warning:
/sketch.ino:620:error: missing terminating " character
I understand that such double slashes inside double quotes may be wrongly interpreted as comment and then compilation is stopped due to truncation, in contrast to that is found in classic Arduino IDE (1.0.6) for the same sketch.
Amazingly, when this sketch is divided in multiple files (.h,.cpp,.ino) and the above line 620 included in header part of the .cpp file, this warning doesn't occur and compilation is OK in UECIDE as well as arduino IDE.
What could be the correct writing for this string in UECIDE editor to prevent this discrepancy ?

2) How can we understand this warning, although compilation of the corresponding sketch is completed to the end :
Editor.java 2456 (error): /Users/xxxx/Library/uecide/cache/arduino/mega2560/libCore_api.a(HardwareSerial.cpp.o):/Users/xxxx/Library/uecide/cores/arduino/api/HardwareSerial.cpp:304: warning: internal error: out of range error
Editor.java 2456 (error): /Users/xxxxLibrary/uecide/cache/arduino/mega2560/libCore_api.a(HardwareSerial.cpp.o):(.rodata._ZTV14HardwareSerial+0x4): warning: internal error: out of range error
Editor.java 2456 (error): /Users/xxxx/Library/uecide/cache/arduino/mega2560/libCore_api.a(HardwareSerial.cpp.o):(.rodata._ZTV14HardwareSerial+0x6): warning: internal error: out of range error
etc…
Thanks for your help
Achille
 
Posts: 11
Joined: Tue Jan 27, 2015 1:44 am
I use UECIDE on: OS X
 

Re: amazing warnings for arduino compilation

Postby matt » Fri Jan 30, 2015 8:06 pm

You're right about it being interpreted as a comment. The problem is actually the pre-processor in the IDE. It doesn't like double slashes in strings at the moment. It strips out all comments, and it identifies that as a comment, and chops the line off at "http:

If you put it in a header or other source (not .ino) file then the pre-processor isn't run on the file, so it doesn't chop it up. It's a problem I've been wrestling with for a while now.

The simplest fix is just to break your string at the slashes:

Code: Select all
const String ipServerLocal="http:/" "/192.168.1.18";


The rest of the warnings you're seeing is basically because the flash memory overflowed because it was filled up with a string containing all your source code from that broken line onwards.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".
matt
Site Admin
 
Posts: 1318
Joined: Sun Jul 07, 2013 11:37 am
I use UECIDE on: Linux
 

Re: amazing warnings for arduino compilation

Postby matt » Fri Jan 30, 2015 9:00 pm

I have just been writing a new parser that seems to work better. A small test file like this:
Code: Select all
/*  This is a block of comments
 *  with lots in it.
 */

// this is a single line comment.

// This is a comment with a /* block in it */

/* This is a block with
 *  // a single line comment in it
 */

const String embeddedBlock = "This is a string with a /* block comment */ in it";
const String embeddedSingle = "This is a string with a // single line comment in it";

void setup() {
}

void loop() {
}

now produces output like this:
Code: Select all
/***************************************************
 * ! ! ! !        I M P O R T A N T        ! ! ! ! *
 *                                                 *
 * THIS FILE IS AUTOMATICALLY GENERATED AND SHOULD *
 * NOT BE DIRECTLY EDITED. INSTEAD EDIT THE INO OR *
 * PDE FILE THIS FILE IS GENERATED FROM!!!         *
 ***************************************************/

#include <Arduino.h>
#line 1 "/tmp/untitled3/untitled3.ino"












const String embeddedBlock = "This is a string with a /* block comment */ in it";
const String embeddedSingle = "This is a string with a // single line comment in it";

void setup();
void loop();
#line 16 "/tmp/untitled3/untitled3.ino"
void setup() {
}

void loop() {
}

So far everything looks groovy with it.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".
matt
Site Admin
 
Posts: 1318
Joined: Sun Jul 07, 2013 11:37 am
I use UECIDE on: Linux
 

Re: amazing warnings for arduino compilation

Postby Achille » Sun Feb 01, 2015 7:57 pm

Thanks matt. First point is OK after correcting all "//" included in Strings as suggested. But the second warnings remain. The sketch compiles well in arduino IDE and run , not in UECIDE: Here is the end of compilation in UECIDE:
    • Linking sketch...
    /compilers/avr-gcc/bin/avr-gcc -Wl,--gc-sections -Os -mmcu=atmega2560 -o /var/folders/yG/yG6JYmnh2RWbfk+1YvpJI++++Tc/-Tmp-/untitled49/build/untitled49.elf /var/folders/yG/yG6JYmnh2RWbfk+1YvpJI++++Tc/-Tmp-/untitled49/build/untitled49.cpp.o -L/var/folders/yG/yG6JYmnh2RWbfk+1YvpJI++++Tc/-Tmp-/untitled49/build -L/cache/arduino/mega2560 -Wl,--start-group -lcat_OneWire -lcore_SPI -lcat_Ethernet -lcat_DS1307RTC -lcat_Xively -lcat_dht -lcat_SoftTimer -lcat_Base64 -lcat_HttpClient -lcat_Time -lcat_Servo -lcat_SdFat -lcat_Timer3 -lcore_Wire -lCore_api -Wl,--end-group -lm
    /cache/arduino/mega2560/libcat_SdFat.a(SdFile.cpp.o):(.rodata._ZTV6SdFile+0x6): warning: internal error: out of range error
    /cache/arduino/mega2560/libcat_SdFat.a(MinimumSerial.cpp.o):(.rodata._ZTV13MinimumSerial+0x6): warning: internal error: out of range error
    /cache/arduino/mega2560/libCore_api.a(HardwareSerial.cpp.o):/cores/arduino/api/HardwareSerial.cpp:304: warning: internal error: out of range error
    /cache/arduino/mega2560/libCore_api.a(HardwareSerial.cpp.o):(.rodata._ZTV14HardwareSerial+0x4): warning: internal error: out of range error
    /cache/arduino/mega2560/libCore_api.a(HardwareSerial.cpp.o):(.rodata._ZTV14HardwareSerial+0x6): warning: internal error: out of range error
    /cache/arduino/mega2560/libCore_api.a(HardwareSerial.cpp.o):(.rodata._ZTV14HardwareSerial+0x8): warning: internal error: out of range error
    /cache/arduino/mega2560/libCore_api.a(HardwareSerial.cpp.o):(.rodata._ZTV14HardwareSerial+0xa): warning: internal error: out of range error
    /cache/arduino/mega2560/libCore_api.a(HardwareSerial.cpp.o):(.rodata._ZTV14HardwareSerial+0xc): warning: internal error: out of range error
    /cache/arduino/mega2560/libCore_api.a(HardwareSerial.cpp.o):(.rodata._ZTV14HardwareSerial+0xe): warning: internal error: out of range error
    /cache/arduino/mega2560/libCore_api.a(IPAddress.cpp.o):/cores/arduino/api/IPAddress.cpp:34: warning: internal error: out of range error
    /cache/arduino/mega2560/libCore_api.a(IPAddress.cpp.o):(.rodata._ZTV9IPAddress+0x4): warning: internal error: out of range error
    /cache/arduino/mega2560/libCore_api.a(main.cpp.o): In function `main':
    /cores/arduino/api/main.cpp:44: warning: internal error: out of range error
    /cores/arduino/api/main.cpp:44: warning: internal error: out of range error
    /compilers/avr-gcc/bin/avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 /var/folders/yG/yG6JYmnh2RWbfk+1YvpJI++++Tc/-Tmp-/untitled49/build/untitled49.elf /var/folders/yG/yG6JYmnh2RWbfk+1YvpJI++++Tc/-Tmp-/untitled49/build/untitled49.eep
    /compilers/avr-gcc/bin/avr-objdump -h -S /var/folders/yG/yG6JYmnh2RWbfk+1YvpJI++++Tc/-Tmp-/untitled49/build/untitled49.elf
    /compilers/avr-gcc/bin/avr-objcopy -O ihex -R .eeprom /var/folders/yG/yG6JYmnh2RWbfk+1YvpJI++++Tc/-Tmp-/untitled49/build/untitled49.elf /var/folders/yG/yG6JYmnh2RWbfk+1YvpJI++++Tc/-Tmp-/untitled49/build/untitled49.hex
    Compiling done.
    Memory usage
    /compilers/avr-gcc/bin/avr-size /var/folders/yG/yG6JYmnh2RWbfk+1YvpJI++++Tc/-Tmp-/untitled49/build/untitled49.elf
    • Program size: 146114 bytes
    • Memory size: 6128 bytes
    • Compilation took 12.632 seconds

Does it really means overflow of flash memory?
Achille
 
Posts: 11
Joined: Tue Jan 27, 2015 1:44 am
I use UECIDE on: OS X
 

Re: amazing warnings for arduino compilation

Postby matt » Sun Feb 01, 2015 8:04 pm

No, it means you're running into a known problem with the WinAVR GCC linker.

http://www.avrfreaks.net/forum/linker-error-warning-internal-error-out-range-error

I am not sure what Arduino have done to fix the problem - I'll have to experiment. Can you post your entire code here so I can experiment with it? Also links to any libraries you're using.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".
matt
Site Admin
 
Posts: 1318
Joined: Sun Jul 07, 2013 11:37 am
I use UECIDE on: Linux
 

Re: amazing warnings for arduino compilation

Postby Achille » Mon Feb 02, 2015 3:02 am

I do not understand why this sketch compiles without warnings and run fine from arduino IDE 1.0.1 to 1.0.6 macosX but not in UECIDE 0.8.7 to 0.8.7z35 with same compiler and libraries. This is due to subtle differences between them instead. My code with many supplementary libraries is too big and complex to be joined here for a short test, sorry.
Does SDFat.h lib makes problem, or PROGMEM use?
Achille
 
Posts: 11
Joined: Tue Jan 27, 2015 1:44 am
I use UECIDE on: OS X
 

Re: amazing warnings for arduino compilation

Postby matt » Mon Feb 02, 2015 10:47 am

Sorry, I was getting confused between bugs here. I was mixing yours up with a windows-only bug and my brain was erroneously thinking you were on Windows.

So ... OSX compiler then. Should be the same as the Linux compiler.

Try installing the avr-gcc-481 compiler and see if that works for you. The default compiler is something really ancient.

Also, if you can do a verbose compile for me on Arduino and post a selection of the compilation commands - one "gcc" command, a "g++" command, and the final linking command, I can then look at the differences in the commands being used.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".
matt
Site Admin
 
Posts: 1318
Joined: Sun Jul 07, 2013 11:37 am
I use UECIDE on: Linux
 

Re: amazing warnings for arduino compilation

Postby matt » Mon Feb 02, 2015 12:19 pm

Ok, I may have found something to help.

If you can find the board.txt file for the mega2560, and edit it - look for the line
Code: Select all
board.flags=-DARDUINO_MEGA

and add "::--Wl,--relax" to the end of it so it reads:
Code: Select all
board.flags=-DARDUINO_MEGA::-Wl,--relax

See if that helps.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".
matt
Site Admin
 
Posts: 1318
Joined: Sun Jul 07, 2013 11:37 am
I use UECIDE on: Linux
 

Re: amazing warnings for arduino compilation

Postby matt » Mon Feb 02, 2015 12:29 pm

Actually, that won't do anything. You also need to modify the compiler.

Give me a mo and I'll build some new packages to do it for us.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".
matt
Site Admin
 
Posts: 1318
Joined: Sun Jul 07, 2013 11:37 am
I use UECIDE on: Linux
 

Re: amazing warnings for arduino compilation

Postby matt » Mon Feb 02, 2015 1:12 pm

ok, upgrade the board and compiler packages and hopefully it will be fixed now.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".
matt
Site Admin
 
Posts: 1318
Joined: Sun Jul 07, 2013 11:37 am
I use UECIDE on: Linux
 
 
Next

Return to Arduino / AVR

Who is online

Users browsing this forum: No registered users and 1 guest

cron