Arduino pro mini: Upload verification error due to Serial.print(double)

Hi,

For the last few hours I've been bumping my head against this message, which I got after uploading a sketch to my Arduino Pro Mini. The error was:

"avrdude: verification error, first mismatch at byte 0x0000"

I'd like to report my fix, because I couldn't find anyone else talking about this. Here it is:

I've narrowed the problem to a Serial.print() statement which was trying to output a variable of type "double". Double is an unsupported type for Serial.print (I realized after some digging - thanks compiler for not complaining!).

But it's still strange that this error happens…. when that statement is in my program, the upload fails. I find this to be weird behavior (especially since that error pops up right after uploading; also especially since that piece of code doesn't run unless I touch a button in my project). Seems like a bug with the boot loader?

Anyway, I just wanted to post this so it shows up in people's Google searches. Hope it's useful, and maybe someone investigates why this happens.

"avrdude: verification error, first mismatch at byte 0x0000"

I saw this error already, during experiments with bootloader. I don't know circumstances and the reason (my mystake in circuit or settings...) but reburning the bootloader, it helps.

I've narrowed the problem to a Serial.print() statement which was trying to output a variable of type "double". Double is an unsupported type for Serial.print (I realized after some digging - thanks compiler for not complaining!).
/quote]
Why should the compiler complain?
"double" is a perfectly valid type.
That it is represented in the same format as a float on the AVR Arduinos is neither here nor there.
"Print.h"    size_t print(double, int = 2);
"Print.cpp"

size_t Print::print(double n, int digits)

{
  return printFloat(n, digits);
}