arduino / ArduinoCore-sam

80 stars 108 forks source link

Arduino Zero (SAM) SerialUSB.print(-2147483648); #86

Open avandalen opened 7 years ago

avandalen commented 7 years ago

Printing at the Arduino Zero (SAM) gives an error with:

SerialUSB.print(-2147483648);

Error message: exit status 1 call of overloaded 'print(long long int)' is ambiguous

This goes well: int s = -2147483648; SerialUSB << s << endl;

oqibidipo commented 7 years ago

Arduino Zero (SAM)

SAMD actually.

The type of -2147483648 is long long int, because 2147483648 does not fit into int or long int. The sign is not part of the constant, but an unary operator. There is no print(long long int) in the Print class.