Gadgetoid / doglcd-arduino

Automatically exported from code.google.com/p/doglcd
0 stars 0 forks source link

Conflicting return type error on compile with Arduino 0022 #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Upgrading to Arduino 0022 and latest dogLCD library I'm now receiving the 
following error when compiling my projects:

\Arduino\libraries\doglcd/DogLcd.h:236: error: conflicting return type 
specified for 'virtual size_t DogLcd::write(uint8_t)'
E:\00_Projects\arduino-0022\hardware\arduino\cores\arduino/Print.h:40: error:   
overriding 'virtual void Print::write(uint8_t)'

Original issue reported on code.google.com by madeino...@gmail.com on 10 Oct 2011 at 5:34

GoogleCodeExporter commented 9 years ago
my mistake, just found out the changes on Arduino v1.0 RC so latest version of 
this library is only compatible with v1.0RC not arduino 0022 or below, have 
reverted to prior version of this library

Original comment by madeino...@gmail.com on 10 Oct 2011 at 6:24

GoogleCodeExporter commented 9 years ago
Here is a patch that makes it compatible with both.

Original comment by paul.sto...@gmail.com on 29 Oct 2011 at 7:31

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch. I wasn't sure if its better to release 2 versions of the 
library (pre vs. port arduino-1.0) or put in some #ifdef#s like in your patch.

I guess the #ifdef stuff is the better option.

But since I'm no a C++ expert, why is there the  

using Print::write;

statement in the Patch? Do we need this?
Class DogLcd is derived from class Print and implements the virtual function 
write()

I couldn't find out why the using directiove is in the patch. 
The code compiles fine on 0022 and 1.0 (-Wall turned on)

Original comment by e.fa...@wayoda.org on 29 Oct 2011 at 11:22

GoogleCodeExporter commented 9 years ago
using Print::write allows the other write() API functions to work.

char *str="my string";
lcd.write(str)

and

char buf[4] = {'t','e','s','r'};
lcd.write(buf, 4);

Without using Print::write, these won't compile.

Original comment by paul.sto...@gmail.com on 29 Oct 2011 at 3:27

GoogleCodeExporter commented 9 years ago
I applied the patch, but had no time yet to check this with my hardware.
I have uploaded a release candidate for testing. 

Original comment by e.fa...@wayoda.org on 30 Oct 2011 at 3:27

GoogleCodeExporter commented 9 years ago
I did some hardware tests with Arduino 0022 and Arduino 1.0-RC2 and it looks 
like the library is fit for both versions. 

If Arduino can go for version 1.0 with 325 issues on the TODO list, I guess its 
ok to also push the DogLcd Version number to 1.0.0 ;-)

Original comment by e.fa...@wayoda.org on 7 Nov 2011 at 4:32

GoogleCodeExporter commented 9 years ago
I tested DogLcd 1.0.0 on a Teensy 2.0 with both Arduino 0022 and 1.0-rc2.  
Works great.  :-)

As for Arduino's issue list, seems like a lot of it is old or abandoned ideas.  
At least a few "patches welcome" issues where I've submitted a patch, but it's 
sitting unused.  Some have sat for so long that nearby code has changed and the 
patches don't apply cleanly anymore.  Doesn't exactly inspire a lot of 
enthuasiasm to contribute....

Original comment by paul.sto...@gmail.com on 7 Nov 2011 at 9:58