#2038 closed defect (fixed)

C99 integer type mismatch in GCC and Newlib

Reported by: Sebastian Huber Owned by: Ralf Corsepius
Priority: normal Milestone: 4.11
Component: tool/gcc Version: 4.11
Severity: normal Keywords:
Cc: chrisj@…, gedare@… Blocked By:
Blocking:

Description

GCC has two tests which check if some types internal to GCC are equal to the one defined in stdint.h:

gcc/testsuite/gcc.dg/c99-stdint-5.c
gcc/testsuite/gcc.dg/c99-stdint-6.c

GCC test results:

/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/gcc.dg/c99-stdint-5.c: In function 'check_types':

/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/gcc.dg/c99-stdint-5.c:59:3: error: initialization from incompatible pointer type

/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/gcc.dg/c99-stdint-5.c:59:3: error: initialization from incompatible pointer type

/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/gcc.dg/c99-stdint-5.c:62:3: error: initialization from incompatible pointer type

/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/gcc.dg/c99-stdint-5.c:62:3: error: initialization from incompatible pointer type

/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/gcc.dg/c99-stdint-6.c: In function 'check_types':

/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/gcc.dg/c99-stdint-6.c:64:3: error: initialization from incompatible pointer type

/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/gcc.dg/c99-stdint-6.c:64:3: error: initialization from incompatible pointer type

/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/gcc.dg/c99-stdint-6.c:67:3: error: initialization from incompatible pointer type

/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/gcc.dg/c99-stdint-6.c:67:3: error: initialization from incompatible pointer type

I am not sure how to fix this.

Attachments (2)

newlib-rtems4.11-stdint.patch (3.2 KB) - added by Ralf Corsepius on Mar 14, 2012 at 5:35:28 AM.
Honor [U]INTPTR_TYPE for [u]intptr_t.
stdint.h (13.9 KB) - added by Sebastian Huber on Mar 30, 2012 at 2:29:47 PM.
Alternative stdint.h

Download all attachments as: .zip

Change History (9)

Changed on Mar 14, 2012 at 5:35:28 AM by Ralf Corsepius

Honor [U]INTPTR_TYPE for [u]intptr_t.

comment:1 Changed on Mar 28, 2012 at 3:25:17 PM by Ralf Corsepius

Resolution: fixed
Status: newclosed

comment:2 Changed on Mar 29, 2012 at 3:35:33 AM by Chris Johns

Cc: Chris Johns added

Changed on Mar 30, 2012 at 2:29:47 PM by Sebastian Huber

Attachment: stdint.h added

Alternative stdint.h

comment:3 Changed on Apr 2, 2012 at 2:41:50 PM by Gedare Bloom

Cc: Gedare Bloom added

comment:4 Changed on Mar 22, 2013 at 2:25:55 PM by Sebastian Huber

Testing with the GCC 4.8 release candidate and a vanilla Newlib HEAD on ARM and PowerPC shows no failures in the stdint tests of the GCC test suite. I don't know yet why the error disappeared.

comment:5 Changed on Nov 22, 2014 at 12:34:57 PM by Gedare Bloom

Milestone: 4.11

comment:6 Changed on Nov 23, 2014 at 3:50:06 PM by Gedare Bloom

Version: unknown4.11

Set version based on title name, these seem obviously to only affect 4.11

comment:7 Changed on Oct 10, 2017 at 5:58:26 AM by Sebastian Huber

Component: GCCtool/gcc
Note: See TracTickets for help on using tickets.