* [patch]: Fix build for GO32 and WIN32 targets
@ 2010-01-21 14:12 Kai Tietz
2010-01-21 14:15 ` Pedro Alves
2010-01-21 18:00 ` Eli Zaretskii
0 siblings, 2 replies; 10+ messages in thread
From: Kai Tietz @ 2010-01-21 14:12 UTC (permalink / raw)
To: gdb-patches
Hello,
the function check_syscall in file inflow.c is static, but isn't used
for GO32 and _WIN32 targets. So this leads to "defined but not used"
warning and breaks build. Patch fix this
2010-01-21 Kai Tietz <kai.tietz@onevision.com>
* inflow.c (check_syscall): Guard by #if clause for GO32 and WIN32 targets.
Tested for i686-pc-cygwin, x86_64-w64-mingw32, and i686-pc-mingw32. Ok
for apply?
Regards,
Kai
Index: inflow.c
===================================================================
RCS file: /cvs/src/src/gdb/inflow.c,v
retrieving revision 1.56
diff -u -r1.56 inflow.c
--- inflow.c 19 Jan 2010 09:39:12 -0000 1.56
+++ inflow.c 21 Jan 2010 14:11:55 -0000
@@ -633,7 +633,7 @@
inferior_thisrun_terminal = ttyname;
}
-
+#if !defined(__GO32__) && !defined(_WIN32)
/* If RESULT, assumed to be the return value from a system call, is
negative, print the error message indicated by errno and exit.
MSG should identify the operation that failed. */
@@ -646,6 +646,7 @@
_exit (1);
}
}
+#endif
void
new_tty (void)
--
| (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [patch]: Fix build for GO32 and WIN32 targets
2010-01-21 14:12 [patch]: Fix build for GO32 and WIN32 targets Kai Tietz
@ 2010-01-21 14:15 ` Pedro Alves
2010-01-21 14:26 ` Kai Tietz
2010-01-21 18:00 ` Eli Zaretskii
1 sibling, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2010-01-21 14:15 UTC (permalink / raw)
To: gdb-patches; +Cc: Kai Tietz
On Thursday 21 January 2010 14:12:35, Kai Tietz wrote:
> 2010-01-21 Kai Tietz <kai.tietz@onevision.com>
>
> * inflow.c (check_syscall): Guard by #if clause for GO32 and WIN32 targets.
Ok.
--
Pedro Alves
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch]: Fix build for GO32 and WIN32 targets
2010-01-21 14:15 ` Pedro Alves
@ 2010-01-21 14:26 ` Kai Tietz
0 siblings, 0 replies; 10+ messages in thread
From: Kai Tietz @ 2010-01-21 14:26 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
2010/1/21 Pedro Alves <pedro@codesourcery.com>:
> On Thursday 21 January 2010 14:12:35, Kai Tietz wrote:
>
>> 2010-01-21 Kai Tietz <kai.tietz@onevision.com>
>>
>> * inflow.c (check_syscall): Guard by #if clause for GO32 and WIN32 targets.
>
> Ok.
>
> --
> Pedro Alves
>
Ok, applied.
Kai
--
| (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch]: Fix build for GO32 and WIN32 targets
2010-01-21 14:12 [patch]: Fix build for GO32 and WIN32 targets Kai Tietz
2010-01-21 14:15 ` Pedro Alves
@ 2010-01-21 18:00 ` Eli Zaretskii
2010-01-21 21:24 ` Pedro Alves
1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2010-01-21 18:00 UTC (permalink / raw)
To: Kai Tietz; +Cc: gdb-patches
> Date: Thu, 21 Jan 2010 15:12:35 +0100
> From: Kai Tietz <ktietz70@googlemail.com>
>
> Hello,
>
> the function check_syscall in file inflow.c is static, but isn't used
> for GO32 and _WIN32 targets. So this leads to "defined but not used"
> warning and breaks build. Patch fix this
I don't understand. How come all other ports don't hit the same
problem? AFAIK, this feature is not yet implemented on all of them.
What am I missing?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch]: Fix build for GO32 and WIN32 targets
2010-01-21 18:00 ` Eli Zaretskii
@ 2010-01-21 21:24 ` Pedro Alves
2010-01-21 22:05 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2010-01-21 21:24 UTC (permalink / raw)
To: gdb-patches, Eli Zaretskii; +Cc: Kai Tietz
On Thursday 21 January 2010 18:00:38, Eli Zaretskii wrote:
> > Date: Thu, 21 Jan 2010 15:12:35 +0100
> > From: Kai Tietz <ktietz70@googlemail.com>
> >
> > Hello,
> >
> > the function check_syscall in file inflow.c is static, but isn't used
> > for GO32 and _WIN32 targets. So this leads to "defined but not used"
> > warning and breaks build. Patch fix this
>
> I don't understand. How come all other ports don't hit the same
> problem? AFAIK, this feature is not yet implemented on all of them.
> What am I missing?
Reading the code? ;-) All the callers of check_syscall are
wrapped inside:
#if !defined(__GO32__) && !defined(_WIN32)
The warning is now triggering because we've recently started
building gdb with -Wunused-function.
--
Pedro Alves
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch]: Fix build for GO32 and WIN32 targets
2010-01-21 21:24 ` Pedro Alves
@ 2010-01-21 22:05 ` Eli Zaretskii
2010-01-21 22:18 ` Pedro Alves
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2010-01-21 22:05 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches, ktietz70
> From: Pedro Alves <pedro@codesourcery.com>
> Date: Thu, 21 Jan 2010 21:24:21 +0000
> Cc: Kai Tietz <ktietz70@googlemail.com>
>
> All the callers of check_syscall are wrapped inside:
>
> #if !defined(__GO32__) && !defined(_WIN32)
Yes, but why?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch]: Fix build for GO32 and WIN32 targets
2010-01-21 22:05 ` Eli Zaretskii
@ 2010-01-21 22:18 ` Pedro Alves
2010-01-22 7:36 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2010-01-21 22:18 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches, ktietz70
On Thursday 21 January 2010 22:05:37, Eli Zaretskii wrote:
> > From: Pedro Alves <pedro@codesourcery.com>
> > Date: Thu, 21 Jan 2010 21:24:21 +0000
> > Cc: Kai Tietz <ktietz70@googlemail.com>
> >
> > All the callers of check_syscall are wrapped inside:
> >
> > #if !defined(__GO32__) && !defined(_WIN32)
>
> Yes, but why?
Presumably because it's doing things that aren't either
supported or needed on those targets. I don't think that
matters in the context of this patch. I've answered your
question of why don't other targets hit the same
problem. If there's something to should be done to
implement some missing bits for djgpp or mingw, that's
a completely separate change.
--
Pedro Alves
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch]: Fix build for GO32 and WIN32 targets
2010-01-21 22:18 ` Pedro Alves
@ 2010-01-22 7:36 ` Eli Zaretskii
2010-01-22 14:08 ` Pedro Alves
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2010-01-22 7:36 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches, ktietz70
> From: Pedro Alves <pedro@codesourcery.com>
> Date: Thu, 21 Jan 2010 22:18:44 +0000
> Cc: gdb-patches@sourceware.org, ktietz70@googlemail.com
>
> I've answered your question of why don't other targets hit the same
> problem. If there's something to should be done to implement some
> missing bits for djgpp or mingw, that's a completely separate
> change.
I never said that I objected to this change (I don't), I just wanted
to understand it, regardless.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch]: Fix build for GO32 and WIN32 targets
2010-01-22 7:36 ` Eli Zaretskii
@ 2010-01-22 14:08 ` Pedro Alves
2010-01-22 17:09 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2010-01-22 14:08 UTC (permalink / raw)
To: gdb-patches, Eli Zaretskii; +Cc: ktietz70
On Friday 22 January 2010 07:34:14, Eli Zaretskii wrote:
> > From: Pedro Alves <pedro@codesourcery.com>
> > Date: Thu, 21 Jan 2010 22:18:44 +0000
> > Cc: gdb-patches@sourceware.org, ktietz70@googlemail.com
> >
> > I've answered your question of why don't other targets hit the same
> > problem. If there's something to should be done to implement some
> > missing bits for djgpp or mingw, that's a completely separate
> > change.
>
> I never said that I objected to this change (I don't), I just wanted
> to understand it, regardless.
>
Before Kai's patch, the code looked like
static
check_syscall ()
{
...
}
new_tty ()
{
#if !defined(__GO32__) && !defined(_WIN32)
check_syscall ();
#endif
}
So, check_syscall was never called in a djgpp or win32 build of
gdb. This was fine up recently, when we introduced
the -Wunused-function warning, because it now warns on
djgpp and win32 that check_syscall is never used. With -Werror, that
warning becomes an error, so the build is broken. The fix is obvious,
wrap check_syscall in `#if !defined(__GO32__) && !defined(_WIN32)' too.
That's precisely, and only, what Kai's patch did.
You seem to be asking why are all the calls to
check_syscall compiled out on djgpp and win32. If you actually
try looking at the code, and who is calling it, you'll see that
this is code that runs in the context of the inferior process,
not gdb, in the fork_inferior dance, when creating a new
inferior. These targets don't use fork_inferior to create a
process. The code is ifdefed out presumably because
it wouldn't compile on those systems.
--
Pedro Alves
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [patch]: Fix build for GO32 and WIN32 targets
2010-01-22 14:08 ` Pedro Alves
@ 2010-01-22 17:09 ` Eli Zaretskii
0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2010-01-22 17:09 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches, ktietz70
> From: Pedro Alves <pedro@codesourcery.com>
> Date: Fri, 22 Jan 2010 14:08:40 +0000
> Cc: ktietz70@googlemail.com
>
> You seem to be asking why are all the calls to
> check_syscall compiled out on djgpp and win32.
Yes, that's what I was asking.
> If you actually try looking at the code, and who is calling it,
> you'll see that this is code that runs in the context of the
> inferior process, not gdb, in the fork_inferior dance, when creating
> a new inferior. These targets don't use fork_inferior to create a
> process. The code is ifdefed out presumably because it wouldn't
> compile on those systems.
Thanks for explaining this to me.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-01-22 17:09 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-21 14:12 [patch]: Fix build for GO32 and WIN32 targets Kai Tietz
2010-01-21 14:15 ` Pedro Alves
2010-01-21 14:26 ` Kai Tietz
2010-01-21 18:00 ` Eli Zaretskii
2010-01-21 21:24 ` Pedro Alves
2010-01-21 22:05 ` Eli Zaretskii
2010-01-21 22:18 ` Pedro Alves
2010-01-22 7:36 ` Eli Zaretskii
2010-01-22 14:08 ` Pedro Alves
2010-01-22 17:09 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox