This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/42114] New: c99-stdint test fails for ptrdiff test


Test gcc.dg/c99-stdint-1.c checks for range of__PTRDIFF_TYPE__ and fails for
avr target.

test_misc_limits (void)
{
  CHECK_SIGNED_LIMITS_2(__PTRDIFF_TYPE__, PTRDIFF_MIN, PTRDIFF_MAX, -65535L,
65535L);


On AVR pointers and integers are 16bit. 

INTPTR_MIN =-32768
INTPTR_MAX = 32767
UINTPTR_MAX = 65535U

__PTRDIFF_MAX__ is set by gcc at 32767 and so stdint.h gives PTRDIFF_MAX 32767
and PTRDIFF_MIN -32768

I am not sure why minimum range limits are applied in this test or if
test/gcc/target is wrong.


-- 
           Summary: c99-stdint test fails for ptrdiff test
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hutchinsonandy at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr-unknown-none


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42114


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]