[PATCH][Ada][ARM] warning/Werror: implicit declaration of function 'arm_float_words_big_endian'

Laurent GUERBY laurent@guerby.net
Mon Sep 7 07:57:00 GMT 2009


Hi

Is the below patch okay with Ada maintainers? It is needed to get
Ada working on arm without adding --disable-werror at configure time.

Thanks in advance,

Laurent

On Sun, 2009-08-23 at 18:50 +0200, Laurent GUERBY wrote:
> Hi,
> 
> While compiling Ada on arm I get a warning about
> arm_float_words_big_endian in stage1 and it becomes an error due to
> -Werror in later stages:
> 
> gcc -c  -g -fkeep-inline-functions -DIN_GCC   -W -Wall -Wwrite-strings
> -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
> -Wmissing-format-attribute -Wno-long-long -Wno-variadic-macros
> -Wno-overlength-strings -Wold-style-definition -Wc++-compat -fno-common
> -DHAVE_CONFIG_H -I.. -I. -Iada -I../../trunk/gcc -I../../trunk/gcc/ada
> -I../../trunk/gcc/../include -I../../trunk/gcc/../libcpp/include
> -I/opt/cfarm/mpfr-2.4.1//include -I../../trunk/gcc/../libdecnumber
> -I../../trunk/gcc/../libdecnumber/dpd
> -I../libdecnumber    ../../trunk/gcc/ada/gcc-interface/targtyps.c -o
> ada/targtyps.o
> ../../trunk/gcc/ada/gcc-interface/targtyps.c: In function
> 'get_float_words_be':
> ../../trunk/gcc/ada/gcc-interface/targtyps.c:197: warning: implicit
> declaration of function 'arm_float_words_big_endian'
> 
> Looking at the code:
> 
> ada/gcc-interface/targtyps.c =>
> 
> #ifndef FLOAT_WORDS_BIG_ENDIAN
> #define FLOAT_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
> #endif
> 
> Nat
> get_float_words_be (void)
> {
>   return FLOAT_WORDS_BIG_ENDIAN;
> }
> 
> config/arm.h =>
> 
> /* Define this if most significant word of doubles is the lowest
> numbered.
>    The rules are different based on whether or not we use FPA-format,
>    VFP-format or some other floating point co-processor's format
> doubles.  */
> #define FLOAT_WORDS_BIG_ENDIAN (arm_float_words_big_endian ())
> 
> Looking around for a header definition I found:
> 
> config/arm-protos.h =>
> 
> extern int arm_float_words_big_endian (void);
> 
> arm-protos.h seem to be indirectly included through the generated
> "tm_p.h" in various GCC source files.
> 
> Is the patch below the correct way to fix this warning/error?
> 
> Thanks in advance,
> 
> Laurent
> 
> 2009-08-23  Laurent GUERBY  <laurent@guerby.net>
> 
> 	* gcc-interface/targtyps.c: Add missing include for tm_p.h.
> 
> Index: targtyps.c
> ===================================================================
> --- targtyps.c	(revision 151010)
> +++ targtyps.c	(working copy)
> @@ -29,6 +29,7 @@
>  #include "system.h"
>  #include "coretypes.h"
>  #include "tm.h"
> +#include "tm_p.h"
>  #include "tree.h"
>  
>  #include "ada.h"
> 
> 
> 
> 




More information about the Gcc-patches mailing list