URL:
<http://savannah.nongnu.org/bugs/?24887>
Summary: boot.h not compatible with -mint8 compiler option
Project: AVR C Runtime Library
Submitted by: kenk
Submitted on: Thu 20 Nov 2008 07:41:53 AM GMT
Category: Header
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Header files
Status: None
Percent Complete: 0%
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Release: 1.6.4
Fixed Release: None
_______________________________________________________
Details:
The case where I am seeing this is in the definitions of boot_page*
functions. In here, a check is done against USHRT_MAX. The value of this can
change depending on the usage of the -mint8 compiler switch (making int
default to be 8-bit sized).
Specifically, the comparison (which I notice) is line 597 of boot.h:
#elif (FLASHEND > USHRT_MAX)
The author intended USHRT_MAX to be == 65535, which it is without -mint8,
with -mint8 it's 255. As a result the wrong functions are instantiated.
A test for this might be worth adding to the regression suite as well.
To reproduce, simply call boot_page_erase() (for instance) using a Mega64
architecture. With -mint8, this fails (looking for RAMPZ) without this switch,
success.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?24887>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
_______________________________________________
AVR-libc-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev