Patchwork RFA: fix some avr stdint issues

login
register
mail settings
Submitter Joern Rennecke
Date Aug. 26, 2013, 3:01 p.m.
Message ID <20130826110126.a43cg9k6m88wgkk8-nzlynne@webmail.spamcop.net>
Download mbox | patch
Permalink /patch/269906/
State New
Headers show

Comments

Joern Rennecke - Aug. 26, 2013, 3:01 p.m.
This patch fixes the gcc.dg/c99-stdint-5.c and gcc.dg/c99-stdint-6.c  
excess error
failures.

Tested for atmega128-sim.

OK to apply?
2013-05-26  Joern Rennecke  <joern.rennecke@embecosm.com>

	* config/avr/avr-stdint.h (INT16_TYPE): Change default to "int".
	(UINT16_TYPE): Change default to "unsigned int".
Denis Chertykov - Aug. 26, 2013, 4:34 p.m.
2013/8/26 Joern Rennecke <joern.rennecke@embecosm.com>:
> This patch fixes the gcc.dg/c99-stdint-5.c and gcc.dg/c99-stdint-6.c excess
> error
> failures.
>
> Tested for atmega128-sim.
>
> OK to apply?
>
> 2013-05-26  Joern Rennecke  <joern.rennecke@embecosm.com>
>
>         * config/avr/avr-stdint.h (INT16_TYPE): Change default to "int".
>         (UINT16_TYPE): Change default to "unsigned int".
>

It seems reasonable for me.
Please apply.

Denis.
Georg-Johann Lay - Aug. 27, 2013, 4:28 p.m.
Joern Rennecke wrote:
> This patch fixes the gcc.dg/c99-stdint-5.c and gcc.dg/c99-stdint-6.c 
> excess error failures.

FYI, some of the problems with the c99-stdint tests are related to the 
stdint.h implementation in use.  For example, some types in AVR-Libc's 
stdint.h are not defined in the way the GCC test suite expects them: 
AVR-Libc defines most C99 types by means of attribute mode.

https://savannah.nongnu.org/bugs/?34695#comment7

Johann

Patch

Index: config/avr/avr-stdint.h
===================================================================
--- config/avr/avr-stdint.h	(revision 201989)
+++ config/avr/avr-stdint.h	(working copy)
@@ -34,11 +34,11 @@  the Free Software Foundation; either ver
 #define SIG_ATOMIC_TYPE "char"
 
 #define INT8_TYPE "signed char"
-#define INT16_TYPE (INT_TYPE_SIZE == 16 ? "short int" : "long int")
+#define INT16_TYPE (INT_TYPE_SIZE == 16 ? "int" : "long int")
 #define INT32_TYPE (INT_TYPE_SIZE == 16 ? "long int" : "long long int")
 #define INT64_TYPE (INT_TYPE_SIZE == 16 ? "long long int" : 0)
 #define UINT8_TYPE "unsigned char"
-#define UINT16_TYPE (INT_TYPE_SIZE == 16 ? "short unsigned int" : "long unsigned int")
+#define UINT16_TYPE (INT_TYPE_SIZE == 16 ? "unsigned int" : "long unsigned int")
 #define UINT32_TYPE (INT_TYPE_SIZE == 16 ? "long unsigned int" : "long long unsigned int")
 #define UINT64_TYPE (INT_TYPE_SIZE == 16 ? "long long unsigned int" : 0)