* [RFA] gdb.base/shr1.c: Avoid preprocessor conflict on IRIX
@ 2002-07-29 16:36 Kevin Buettner
2002-07-30 8:32 ` Andrew Cagney
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Kevin Buettner @ 2002-07-29 16:36 UTC (permalink / raw)
To: gdb-patches
Another Irix change. I don't really like this change; I played around
with compiler options in an attempt to avoid changing the source code,
but the only one that I came up with which might work is -Usgi. But
that's dangerous because there may be a system header which depends upon
``sgi''.
So, I relunctantly submit the following patch for approval...
* gdb.base/shr1.c (sgi): Rename to sgi_ to avoid conflict with
implicit -Dsgi on Irix systems.
Index: testsuite/gdb.base/shr1.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/shr1.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 shr1.c
--- testsuite/gdb.base/shr1.c 28 Jun 1999 16:04:00 -0000 1.1.1.2
+++ testsuite/gdb.base/shr1.c 29 Jul 2002 22:28:00 -0000
@@ -4,7 +4,7 @@
typedef float f;
float sg = 5.5;
-int sgi = 2;
+int sgi_ = 2;
static int sgs = 7;
#ifdef PROTOTYPES
@@ -23,7 +23,7 @@ int x;
}
mumble = 7.7;
sg = 6.6;
- sgi++;
+ sgi_++;
sgs = 8;
printf("address of sgs is 0x%x\n", &sgs);
return 2*x;
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [RFA] gdb.base/shr1.c: Avoid preprocessor conflict on IRIX
2002-07-29 16:36 [RFA] gdb.base/shr1.c: Avoid preprocessor conflict on IRIX Kevin Buettner
@ 2002-07-30 8:32 ` Andrew Cagney
2002-07-30 11:27 ` Kevin Buettner
2002-08-26 18:39 ` Michael Snyder
2 siblings, 0 replies; 6+ messages in thread
From: Andrew Cagney @ 2002-07-30 8:32 UTC (permalink / raw)
To: Kevin Buettner; +Cc: gdb-patches
> So, I relunctantly submit the following patch for approval...
>
> * gdb.base/shr1.c (sgi): Rename to sgi_ to avoid conflict with
> implicit -Dsgi on Irix systems.
>
FYI, this should be a comment in the actual file.
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA] gdb.base/shr1.c: Avoid preprocessor conflict on IRIX
2002-07-29 16:36 [RFA] gdb.base/shr1.c: Avoid preprocessor conflict on IRIX Kevin Buettner
2002-07-30 8:32 ` Andrew Cagney
@ 2002-07-30 11:27 ` Kevin Buettner
2002-08-26 18:39 ` Michael Snyder
2 siblings, 0 replies; 6+ messages in thread
From: Kevin Buettner @ 2002-07-30 11:27 UTC (permalink / raw)
To: Kevin Buettner, gdb-patches
On Jul 29, 4:24pm, Kevin Buettner wrote:
> * gdb.base/shr1.c (sgi): Rename to sgi_ to avoid conflict with
> implicit -Dsgi on Irix systems.
I'm withdrawing this patch. David Anderson has convinced me that
using -Usgi is safe enough for the gdb testsuite. I'll post a new
patch to shlib-call.exp.
My thanks to David Anderson for his comments on my patch.
Kevin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA] gdb.base/shr1.c: Avoid preprocessor conflict on IRIX
2002-07-29 16:36 [RFA] gdb.base/shr1.c: Avoid preprocessor conflict on IRIX Kevin Buettner
2002-07-30 8:32 ` Andrew Cagney
2002-07-30 11:27 ` Kevin Buettner
@ 2002-08-26 18:39 ` Michael Snyder
2002-12-03 7:59 ` Fernando Nasser
2 siblings, 1 reply; 6+ messages in thread
From: Michael Snyder @ 2002-08-26 18:39 UTC (permalink / raw)
To: Kevin Buettner; +Cc: gdb-patches
Kevin Buettner wrote:
>
> Another Irix change. I don't really like this change; I played around
> with compiler options in an attempt to avoid changing the source code,
> but the only one that I came up with which might work is -Usgi. But
> that's dangerous because there may be a system header which depends upon
> ``sgi''.
>
> So, I relunctantly submit the following patch for approval...
>
> * gdb.base/shr1.c (sgi): Rename to sgi_ to avoid conflict with
> implicit -Dsgi on Irix systems.
Kevin, did anyone reply?
I think this change is OK -- sgi was wrong to clobber this legal
identifier.
> Index: testsuite/gdb.base/shr1.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/shr1.c,v
> retrieving revision 1.1.1.2
> diff -u -p -r1.1.1.2 shr1.c
> --- testsuite/gdb.base/shr1.c 28 Jun 1999 16:04:00 -0000 1.1.1.2
> +++ testsuite/gdb.base/shr1.c 29 Jul 2002 22:28:00 -0000
> @@ -4,7 +4,7 @@
> typedef float f;
>
> float sg = 5.5;
> -int sgi = 2;
> +int sgi_ = 2;
> static int sgs = 7;
>
> #ifdef PROTOTYPES
> @@ -23,7 +23,7 @@ int x;
> }
> mumble = 7.7;
> sg = 6.6;
> - sgi++;
> + sgi_++;
> sgs = 8;
> printf("address of sgs is 0x%x\n", &sgs);
> return 2*x;
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [RFA] gdb.base/shr1.c: Avoid preprocessor conflict on IRIX
2002-08-26 18:39 ` Michael Snyder
@ 2002-12-03 7:59 ` Fernando Nasser
0 siblings, 0 replies; 6+ messages in thread
From: Fernando Nasser @ 2002-12-03 7:59 UTC (permalink / raw)
To: Michael Snyder; +Cc: Kevin Buettner, gdb-patches
The patch was withdrawn Michael. See below:
--------------------------------------------------
On Jul 29, 4:24pm, Kevin Buettner wrote:
> * gdb.base/shr1.c (sgi): Rename to sgi_ to avoid conflict with
> implicit -Dsgi on Irix systems.
I'm withdrawing this patch. David Anderson has convinced me that
using -Usgi is safe enough for the gdb testsuite. I'll post a new
patch to shlib-call.exp.
My thanks to David Anderson for his comments on my patch.
Kevin
-----------------------------------------------------
Michael Snyder wrote:
> Kevin Buettner wrote:
>
>>Another Irix change. I don't really like this change; I played around
>>with compiler options in an attempt to avoid changing the source code,
>>but the only one that I came up with which might work is -Usgi. But
>>that's dangerous because there may be a system header which depends upon
>>``sgi''.
>>
>>So, I relunctantly submit the following patch for approval...
>>
>> * gdb.base/shr1.c (sgi): Rename to sgi_ to avoid conflict with
>> implicit -Dsgi on Irix systems.
>
>
> Kevin, did anyone reply?
> I think this change is OK -- sgi was wrong to clobber this legal
> identifier.
>
>
>
>>Index: testsuite/gdb.base/shr1.c
>>===================================================================
>>RCS file: /cvs/src/src/gdb/testsuite/gdb.base/shr1.c,v
>>retrieving revision 1.1.1.2
>>diff -u -p -r1.1.1.2 shr1.c
>>--- testsuite/gdb.base/shr1.c 28 Jun 1999 16:04:00 -0000 1.1.1.2
>>+++ testsuite/gdb.base/shr1.c 29 Jul 2002 22:28:00 -0000
>>@@ -4,7 +4,7 @@
>> typedef float f;
>>
>> float sg = 5.5;
>>-int sgi = 2;
>>+int sgi_ = 2;
>> static int sgs = 7;
>>
>> #ifdef PROTOTYPES
>>@@ -23,7 +23,7 @@ int x;
>> }
>> mumble = 7.7;
>> sg = 6.6;
>>- sgi++;
>>+ sgi_++;
>> sgs = 8;
>> printf("address of sgs is 0x%x\n", &sgs);
>> return 2*x;
>
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA] gdb.base/shr1.c: Avoid preprocessor conflict on IRIX
@ 2002-07-29 23:52 David Anderson
0 siblings, 0 replies; 6+ messages in thread
From: David Anderson @ 2002-07-29 23:52 UTC (permalink / raw)
To: gdb-patches
Kevin Buettner <kevinb@redhat.com> writes:
>Another Irix change. I don't really like this change; I played around
>with compiler options in an attempt to avoid changing the source code,
>but the only one that I came up with which might work is -Usgi. But
>that's dangerous because there may be a system header which depends upon
>``sgi''.
No IRIX header (as distinct from
user-written headers) should be standards-correct and
depend on 'sgi' as it's clearly in the user namespace.
Unfortunately a check thru some IRIX headers finds a few
such broken headers :-(
These are not things most apps would #include
as they go into areas not covered by existing standards.
Otherwise someone would have cleaned them up.
./netns/idp_var.h:#ifdef sgi
./netns/ns_pcb.h:#ifdef sgi
./netns/ns.h:#ifdef sgi
./netns/spp_var.h:#ifdef sgi
./netns/ns_error.h:#ifdef sgi
./netns/spp_timer.h:#ifdef sgi
./netns/ns_if.h:#ifdef sgi
./resolv.h:#if ((!defined(BSD)) || (BSD < 199306)) && !defined(sgi)
./arpa/nameser.h
In nearly all of these 'sgi' has no effect unless 'KERNEL'
is also #defined.
In the other ones the effect on gdb test cases should also be nil.
Normally 'sgi' is defined because it was defined before the
C Standard rules came into effect in 1989.
-Usgi seems perfectly sensible to me on IRIX, for compiling
most test code (as long as the test code is not *looking* for -Dsgi :-)
though given what I just discovered your caution is sensible.
But still I think -Usgi would be fine (untested assertion
on my part).
Sign me a little embarrassed: I would not have thought we
still had any such cruft laying around.
David B. Anderson davea@sgi.com http://reality.sgiweb.org/davea
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-12-03 15:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-29 16:36 [RFA] gdb.base/shr1.c: Avoid preprocessor conflict on IRIX Kevin Buettner
2002-07-30 8:32 ` Andrew Cagney
2002-07-30 11:27 ` Kevin Buettner
2002-08-26 18:39 ` Michael Snyder
2002-12-03 7:59 ` Fernando Nasser
2002-07-29 23:52 David Anderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox