Welcome! Log In Create A New Profile

Advanced

Marlin Compiling Errors

Posted by foot2theballs 
Marlin Compiling Errors
March 31, 2016 11:24PM
Up until now, I've been running my first printer-a TEVO Tarantula-with stock, unedited firmware, and I'm trying to implement some much needed changes. After a good amount of searching, then finally having to email the manufacturer, I now have a copy of-what I am assured is-the stock firmware for the printer. Problem is, I loaded that firmware into Arduino, hit 'verify,' and right off the bat, several errors showed up. I was able to Google and eliminate most of them, but I'm left with two errors that I can't find a fix for. They present as follows:

sketch\ultralcd.cpp: In function 'void _lcd_babystep(int, const char*)':

sketch\ultralcd.cpp:406:59: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     if (lcdDrawUpdate) lcd_implementation_drawedit(msg, "");

                                                           ^



I've attached a copy of my ultralcd.cpp file if anyone wants to take a look at it and see if they can't find what's wrong. I need to get these errors cleaned up so I can modify the settings that need it and flash them onto my board. Let me know if I left any important information out and I'll provide it as soon as I can. Thanks!
Attachments:
open | download - ultralcd.cpp (50.1 KB)
Re: Marlin Compiling Errors
April 02, 2016 06:04PM
Probably the best thing to do is take your Configuration.h file and cross its settings over to the RCBugFix branch at GitHub.Com/MarlinFirmware/Marlin.

A huge number of improvements have been made and anything that doesn't go right, you can easily get questions answered.
Re: Marlin Compiling Errors
April 03, 2016 02:19PM
That's just a warning. It should still compile and load.

The problem is that lcd_implementation_drawedit() is declared as:

void lcd_implementation_drawedit(const char* pstr, char* value)

In C/C++, a fixed string (the "" passed to the function) gets promoted to "const char *" when the function expects "char *".

Since the function doesn't modify "value", it probably should be declared "const char *" in the first place, but all it does with "value" is pass it on to another function at the end which is declared the same way. I didn't dig past that, but I'd assume the other function should probably be declared "const char *" too.
Re: Marlin Compiling Errors
April 05, 2016 03:51PM
Hey, thanks for the reply! Sorry, but I know nothing about programming languages or syntax or any of that...are you saying that this problem could be fixed by writing that particular line a different way? Because that's all the other warnings were when I first opened and verified the firmware-syntax stuff. I looked them up with google, and some people that had the same issue posted the same line written slightly differently. I replaced my line with theirs and verified again and that warning was gone.
Re: Marlin Compiling Errors
April 05, 2016 05:04PM
That is perfectly fine that you replaced the line with one that did not give you a warning. But you didn't have to do that. It was just the compiler alerting the programmers that they had gotten a little be sloppy on the type definitions.
Re: Marlin Compiling Errors
April 05, 2016 09:06PM
Yes. Warnings shouldn't prevent your compile from completing and uploading to the arduino. If it's not compiling, then there must be errors. Can you supply a complete dump of the compiler output?
Re: Marlin Compiling Errors
April 05, 2016 11:07PM
I know warnings don't mean I can't upload the firmware to my board, but I'd like to clean up any sloppiness when I find it...I'm a bit of a perfectionist when it comes to these things. I suppose I could just flash it to the board now and fix the warnings later though. And hoxsiew, what I posted in the OP is all that Arduino gives me when I verify the code.
Re: Marlin Compiling Errors
April 06, 2016 11:05AM
Quote
foot2theballs
I know warnings don't mean I can't upload the firmware to my board, but I'd like to clean up any sloppiness when I find it...I'm a bit of a perfectionist when it comes to these things. I suppose I could just flash it to the board now and fix the warnings later though. And hoxsiew, what I posted in the OP is all that Arduino gives me when I verify the code.

I suspect it is already fixed in RCBugFix for Release Candidate #5. Pretty much, we try to get rid of warnings very quickly.
Sorry, only registered users may post in this forum.

Click here to login