[Patch] Make definitions of __PRETTY_FUNCTION__ homogenous

Tristan Gingold gingold@adacore.com
Thu Sep 3 08:56:00 GMT 2009


Hi,

this issue happens only with compilers different from gcc (or very old  
gcc compilers).
The files bfd/libbfd.h and gas/as.h defines __PRETTY_FUNCTION__ but  
using different definition.  As there
is no protection against redeclaration this results in a boring warning.

This patch fixes this nit.  Tested on Alpha and Itanium VMS with HP-C  
(formally DEC C ;-)

Ok to commit ?

Tristan.

gas/
2009-09-03  Tristan Gingold  <gingold@adacore.com>

	* as.h (__PRETTY_FUNCTION__): Use the same definition as bfd/libbfd.h.

Index: as.h
===================================================================
RCS file: /cvs/src/src/gas/as.h,v
retrieving revision 1.63
diff -c -r1.63 as.h
*** as.h	22 Jun 2009 17:56:00 -0000	1.63
--- as.h	3 Sep 2009 08:50:27 -0000
***************
*** 106,112 ****
   #undef NDEBUG
   #endif
   #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)
! #define __PRETTY_FUNCTION__  ((char*)0)
   #endif
   #define gas_assert(P) \
     ((void) ((P) ? 0 : (as_assert (__FILE__, __LINE__,  
__PRETTY_FUNCTION__), 0)))
--- 106,112 ----
   #undef NDEBUG
   #endif
   #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)
! #define __PRETTY_FUNCTION__  ((char *) NULL)
   #endif
   #define gas_assert(P) \
     ((void) ((P) ? 0 : (as_assert (__FILE__, __LINE__,  
__PRETTY_FUNCTION__), 0)))



More information about the Binutils mailing list