Open GoogleCodeExporter opened 9 years ago
Attached are patch files for the latest release of Arduino 1.0.1, to remove
some of the many compiler warnings. These warnings are (mostly) harmless, but
their quantity
obscures warnings in the user's own code. The libraries were compiled using
avr-gcc 4.5.3 and with the FLAGS
CPPFLAGS = -Os -Wall -Wextra -Wconversion -Wcast-align -Wshadow \
-ffunction-sections -fdata-sections -fno-exceptions \
-mmcu=$(MCU) -DF_CPU=$(F_CPU) -DARDUINO=$(ARDUINO_VERSION)
CFLAGS = -std=c99 -pedantic -Wpointer-arith -Wstrict-prototypes
-Wmissing-prototypes
CXXFLAGS = -fno-exceptions -Wsign-promo
The fixes are mostly casts, to deal with C's automatic integer promotions. In
a couple of cases data structures have been changed to avoid pointer alignment
error messages, and some shadowed variables have been renamed.
C W Rose
Original comment by cwrseckf...@gmail.com
on 5 Jul 2012 at 5:37
Attachments:
thanks
dont know what to do with a diff file though,
whens the next release ?
Original comment by andrew6...@gmail.com
on 27 Jul 2012 at 6:51
[deleted comment]
Can the title of this issue be changed to include
HardwareSerial, Print, Tone
Original comment by jaguar3s...@gmail.com
on 28 Aug 2012 at 9:13
I think it would be better to resolve the actual problems by changing the
HardwareSerial.cpp code:
line 78 should be:
unsigned int i = (unsigned int)(buffer->head + 1) % SERIAL_BUFFER_SIZE;
line 387 should be:
unsigned int i = (_tx_buffer->head + 1) % SERIAL_BUFFER_SIZE;
Original comment by jeroendoggen
on 16 Dec 2012 at 3:01
Why are the diffs littered with changes from sbi/cbi to sbi8/cbi8, when that
seems to have nothing to do with the complaint, and sbi8/cbi8 don't seem to be
defined anywhere?
(sbi/cbi themselves are deprecated)
Casts in general are poor fixes. if buffer->head is unsigned, it should be
declared that way.
Original comment by wes...@gmail.com
on 17 Dec 2012 at 2:31
Original issue reported on code.google.com by
drjohnsm...@gmail.com
on 24 Jun 2012 at 10:48