Project

General

Profile

General C++ 101 Questions

Added by ben almost 6 years ago

Hi,

As I study/compile the etherCard & http://jeelabs.org/2010/05/31/jeenode-as-web-server, I don’t understand a few things that the compiler tells me..

1)
For the lines
class Stash : public /*Stream*/ Print, private StashHeader {
and
class BufferFiller : public Print {

I get the message
warning ‘class Stash’ has virtual functions but non-virtual destructor
and
warning: ‘class BufferFiller’ has virtual functions but non-virtual destructor

2)
in the line
void Stash::prepare (const char * fmt, …) {
*segs++ = strlen_P(fmt);
segs++ = (uint16_t) fmt;
the message:
error: cast from ’const char
‘ to ’short unsigned int’ loses precision
warning: ‘short unsigned int’ is promoted to ‘int’ when passed through ‘…’
warning: (so you should pass ‘int’ not ‘short unsigned int’ to ‘va_arg’)
note: if this code is reached, the program will abort

3)
In the line,
class EtherCard : public Ethernet { static void printIp (const _FlashStringHelper *ifsh, const uint8_t *buf);
the message is,
error: ISO C++ forbids declaration of ’FlashStringHelper’ with no type (Note: I see a reference to
_FlashStringHelper in WString.h but not in Arduino.h)

What does it mean?


Replies (1)

RE: General C++ 101 Questions - Added by jcw almost 6 years ago

Are you perhaps compiling for ARM? (which uses 32-bit pointers)

    (1-1/1)