Serial.write() on Leonard is diffrent from Uno and others

I found that following two statements can be compiled for Uno and Duemilanove (probably for all mega168 and 328s) but not for Leonard with Arduino-IDE 1.0.1.

Serial.write("test");
Serial.write((const uint8_t*)"test\n", 5);

Is this a bug or the feature?

// Noriaki Mitsunaga

Edit USBAPI.h.

Find the class: Serial_

Add this line:

  using Print::write; // pull in write(str) and write(buf, size) from Print

Now it compiles without errors.

eg.

//================================================================================
//================================================================================
//	Serial over CDC (Serial1 is the physical port)

class Serial_ : public Stream
{
private:
	ring_buffer *_cdc_rx_buffer;
public:
	void begin(uint16_t baud_count);
	void end(void);

	virtual int available(void);
	virtual void accept(void);
	virtual int peek(void);
	virtual int read(void);
	virtual void flush(void);
	virtual size_t write(uint8_t);
        using Print::write; // pull in write(str) and write(buf, size) from Print    <-------- add this
	operator bool();
};
extern Serial_ Serial;

Sounds like a bug, who knows?

After adding "using Print::write;" to USBAPI.h works fine.

Thank you.

Sounds like a bug, who knows?

Maybe fixed in future release ?

// Noriaki Mitsunaga

Issue opened here: Google Code Archive - Long-term storage for Google Code Project Hosting.