public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* patch for binutils include/ansidecl.h
@ 2002-09-20 13:14 Nathan Tallent
  2002-09-20 13:49 ` DJ Delorie
  0 siblings, 1 reply; 5+ messages in thread
From: Nathan Tallent @ 2002-09-20 13:14 UTC (permalink / raw)
  To: gcc-patches

What follows is a patch for binutils include/ansidecl.h.
-Nathan Tallent

Description:
------------
After a few miserable hours, I finally figured out why including <bfd.h> 
in my C++ code caused a whole slew of inexplicable and mysterious errors 
-- but only on the Compaq compiler.  It was the macro magic of 
ansidecl.h. (Live by the sword, die by the sword. :)

The Compaq C++ compiler, unlike many other C++ compilers, does not 
define __STDC__, though it acts as if this was so. I think this patch is
reasonably general and I consulted the documentation for compiler 
versions 5.7, 6.2, 6.3, 6.5.

Testing and testcases:
----------------------
I have run the binutils regression tests with and without my changes and
the results are the same.

Our tests: We are using bintuils as the binary reader for a program
that performs source code structure recovery on binaries from a number 
of different platforms.  (We esp. focus on loop recovery for scientific
programs.) This program is also a cross-tool and we have successfully
tested these changes (and a number of others to follow eventually) on a
number of different binaries (from GNU and non-GNU compilers) and
platforms.

hosts (all of which are enabled on each platform)
   mips64-sgi-irix6
   alpha-*-linux-gnu, alpha-*-osf
   sparc32-*-elf, sparc64-*-solaris2
   i386-*-linux-gnu
   ia64-*-linux-gnu

ChangeLog:
----------

2002-09-20  Nathan Tallent  <eraxxon@alumni.rice.edu>

	* ansidecl.h (__STDC__): Add (__alpha && __cplusplus) to the
	list of	platform compilers that may look, smell and act
	like __STDC__ but that may not define it.


Patch: include/ansidecl.h
(created with 'cvs diff -c3p' against cvs repository on 9/20/02)
------

Index: ansidecl.h
===================================================================
RCS file: /cvs/src/src/include/ansidecl.h,v
retrieving revision 1.10
diff -c -3 -p -r1.10 ansidecl.h
*** ansidecl.h    29 Aug 2001 20:03:08 -0000    1.10
--- ansidecl.h    20 Sep 2002 18:16:10 -0000
*************** So instead we use the macro below and te
*** 136,145 ****
   #define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
   #endif /* GCC_VERSION */

! #if defined (__STDC__) || defined (_AIX) || (defined (__mips) && 
defined (_SYSTYPE_SVR4)) || defined(_WIN32)
   /* All known AIX compilers implement these things (but don't always
      define __STDC__).  The RISC/OS MIPS compiler defines these things
      in SVR4 mode, but does not define __STDC__.  */

   #define ANSI_PROTOTYPES    1
   #define PTR        void *
--- 136,148 ----
   #define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
   #endif /* GCC_VERSION */

! #if defined (__STDC__) || defined (_AIX) || (defined (__mips) && 
defined (_SYSTYPE_SVR4)) || defined(_WIN32) || (defined(__alpha) && 
defined(__cplusplus))
   /* All known AIX compilers implement these things (but don't always
      define __STDC__).  The RISC/OS MIPS compiler defines these things
      in SVR4 mode, but does not define __STDC__.  */
+ /* eraxxon@alumni.rice.edu: The Compaq C++ compiler, unlike many other
+    C++ compilers, does not define __STDC__, though it acts as if this
+    was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */

   #define ANSI_PROTOTYPES    1
   #define PTR        void *

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: patch for binutils include/ansidecl.h
  2002-09-20 13:14 patch for binutils include/ansidecl.h Nathan Tallent
@ 2002-09-20 13:49 ` DJ Delorie
  2002-10-24 13:45   ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: DJ Delorie @ 2002-09-20 13:49 UTC (permalink / raw)
  To: eraxxon; +Cc: gcc-patches


> 2002-09-20  Nathan Tallent  <eraxxon@alumni.rice.edu>
> 
> 	* ansidecl.h (__STDC__): Add (__alpha && __cplusplus) to the
> 	list of	platform compilers that may look, smell and act
> 	like __STDC__ but that may not define it.

This is OK.

FYI: Either your diff program or your mailer is automatically wrapping
the lines of the patch.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: patch for binutils include/ansidecl.h
  2002-09-20 13:49 ` DJ Delorie
@ 2002-10-24 13:45   ` Daniel Jacobowitz
  2002-10-24 16:27     ` DJ Delorie
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2002-10-24 13:45 UTC (permalink / raw)
  To: DJ Delorie; +Cc: eraxxon, gcc-patches

On Fri, Sep 20, 2002 at 04:48:59PM -0400, DJ Delorie wrote:
> 
> > 2002-09-20  Nathan Tallent  <eraxxon@alumni.rice.edu>
> > 
> > 	* ansidecl.h (__STDC__): Add (__alpha && __cplusplus) to the
> > 	list of	platform compilers that may look, smell and act
> > 	like __STDC__ but that may not define it.
> 
> This is OK.
> 
> FYI: Either your diff program or your mailer is automatically wrapping
> the lines of the patch.

This patch was approved but never applied - Nathan doesn't have a
CVS account.  DJ, is it still needed?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: patch for binutils include/ansidecl.h
  2002-10-24 13:45   ` Daniel Jacobowitz
@ 2002-10-24 16:27     ` DJ Delorie
  2002-10-24 16:30       ` Nathan Tallent
  0 siblings, 1 reply; 5+ messages in thread
From: DJ Delorie @ 2002-10-24 16:27 UTC (permalink / raw)
  To: drow; +Cc: eraxxon, gcc-patches


> This patch was approved but never applied - Nathan doesn't have a
> CVS account.  DJ, is it still needed?

It hasn't been applied, so it's most likely still needed.  I'll hunt
it down and apply it to head.  If it's needed on any branches, if it's
OK with the branch manager it's OK with me too.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: patch for binutils include/ansidecl.h
  2002-10-24 16:27     ` DJ Delorie
@ 2002-10-24 16:30       ` Nathan Tallent
  0 siblings, 0 replies; 5+ messages in thread
From: Nathan Tallent @ 2002-10-24 16:30 UTC (permalink / raw)
  To: DJ Delorie, Daniel Jacobowitz; +Cc: gcc-patches

I can resend it if necessary.  And I've setup an emacs mailer that won't
mangle the code.

-Nathan.

----- Original Message -----
From: "DJ Delorie" <dj@redhat.com>
To: <drow@mvista.com>
Cc: <eraxxon@alumni.rice.edu>; <gcc-patches@gcc.gnu.org>
Sent: Thursday, October 24, 2002 7:27 PM
Subject: Re: patch for binutils include/ansidecl.h


>
> > This patch was approved but never applied - Nathan doesn't have a
> > CVS account.  DJ, is it still needed?
>
> It hasn't been applied, so it's most likely still needed.  I'll hunt
> it down and apply it to head.  If it's needed on any branches, if it's
> OK with the branch manager it's OK with me too.
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-10-24 23:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-20 13:14 patch for binutils include/ansidecl.h Nathan Tallent
2002-09-20 13:49 ` DJ Delorie
2002-10-24 13:45   ` Daniel Jacobowitz
2002-10-24 16:27     ` DJ Delorie
2002-10-24 16:30       ` Nathan Tallent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).