* [COMMITTED PATCH] Fix clang compilation errors in gdb.mi/basics.c
@ 2014-08-25 19:44 Doug Evans
2014-08-25 21:39 ` Andrew Pinski
0 siblings, 1 reply; 3+ messages in thread
From: Doug Evans @ 2014-08-25 19:44 UTC (permalink / raw)
To: gdb-patches
Hi.
This patch gets a few more tests working with clang.
gdb compile failed, ../../../binutils-gdb/gdb/testsuite/gdb.mi/basics.c:32:1: warning: type
specifier missing, defaults to 'int' [-Wimplicit-int]
callee3 (char *strarg)
^
../../../binutils-gdb/gdb/testsuite/gdb.mi/basics.c:35:1: warning: control
reaches end of non-void function [-Wreturn-type]
}
^
...
2014-08-25 Doug Evans <dje@google.com>
* gdb.mi/basics.c (callee3, callee2, callee1): Specify result type.
(main): Ditto.
diff --git a/gdb/testsuite/gdb.mi/basics.c b/gdb/testsuite/gdb.mi/basics.c
index 0a4f9de..0eabcd1 100644
--- a/gdb/testsuite/gdb.mi/basics.c
+++ b/gdb/testsuite/gdb.mi/basics.c
@@ -29,17 +29,17 @@ int callee4 (void)
C = A + B;
return 0;
}
-callee3 (char *strarg)
+void callee3 (char *strarg)
{
callee4 ();
}
-callee2 (int intarg, char *strarg)
+void callee2 (int intarg, char *strarg)
{
callee3 (strarg);
}
-callee1 (int intarg, char *strarg, double fltarg)
+void callee1 (int intarg, char *strarg, double fltarg)
{
callee2 (intarg, strarg);
}
@@ -57,7 +57,7 @@ void do_nothing (void)
{
}
-main ()
+int main ()
{
callee1 (2, "A string argument.", 3.5);
callee1 (2, "A string argument.", 3.5);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [COMMITTED PATCH] Fix clang compilation errors in gdb.mi/basics.c
2014-08-25 19:44 [COMMITTED PATCH] Fix clang compilation errors in gdb.mi/basics.c Doug Evans
@ 2014-08-25 21:39 ` Andrew Pinski
2014-08-25 21:57 ` Doug Evans
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Pinski @ 2014-08-25 21:39 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches
On Mon, Aug 25, 2014 at 12:44 PM, Doug Evans <dje@google.com> wrote:
> Hi.
>
> This patch gets a few more tests working with clang.
Seems like maybe we should be compiling with -w for clang instead of
trying to change the testcase itself. Because now we don't know if
the change to the testcase changed the behavior it was testing or not.
Thanks,
Andrew
>
> gdb compile failed, ../../../binutils-gdb/gdb/testsuite/gdb.mi/basics.c:32:1: warning: type
> specifier missing, defaults to 'int' [-Wimplicit-int]
> callee3 (char *strarg)
> ^
> ../../../binutils-gdb/gdb/testsuite/gdb.mi/basics.c:35:1: warning: control
> reaches end of non-void function [-Wreturn-type]
> }
> ^
> ...
>
> 2014-08-25 Doug Evans <dje@google.com>
>
> * gdb.mi/basics.c (callee3, callee2, callee1): Specify result type.
> (main): Ditto.
>
> diff --git a/gdb/testsuite/gdb.mi/basics.c b/gdb/testsuite/gdb.mi/basics.c
> index 0a4f9de..0eabcd1 100644
> --- a/gdb/testsuite/gdb.mi/basics.c
> +++ b/gdb/testsuite/gdb.mi/basics.c
> @@ -29,17 +29,17 @@ int callee4 (void)
> C = A + B;
> return 0;
> }
> -callee3 (char *strarg)
> +void callee3 (char *strarg)
> {
> callee4 ();
> }
>
> -callee2 (int intarg, char *strarg)
> +void callee2 (int intarg, char *strarg)
> {
> callee3 (strarg);
> }
>
> -callee1 (int intarg, char *strarg, double fltarg)
> +void callee1 (int intarg, char *strarg, double fltarg)
> {
> callee2 (intarg, strarg);
> }
> @@ -57,7 +57,7 @@ void do_nothing (void)
> {
> }
>
> -main ()
> +int main ()
> {
> callee1 (2, "A string argument.", 3.5);
> callee1 (2, "A string argument.", 3.5);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [COMMITTED PATCH] Fix clang compilation errors in gdb.mi/basics.c
2014-08-25 21:39 ` Andrew Pinski
@ 2014-08-25 21:57 ` Doug Evans
0 siblings, 0 replies; 3+ messages in thread
From: Doug Evans @ 2014-08-25 21:57 UTC (permalink / raw)
To: Andrew Pinski; +Cc: gdb-patches
On Mon, Aug 25, 2014 at 2:39 PM, Andrew Pinski <pinskia@gmail.com> wrote:
> On Mon, Aug 25, 2014 at 12:44 PM, Doug Evans <dje@google.com> wrote:
>> Hi.
>>
>> This patch gets a few more tests working with clang.
>
>
> Seems like maybe we should be compiling with -w for clang instead of
> trying to change the testcase itself. Because now we don't know if
> the change to the testcase changed the behavior it was testing or not.
>
> Thanks,
> Andrew
I thought of that.
In this case it would be really unfortunate if a test was relying on
things that this particular patch changes.
In other situations I'm sure I would agree with you.
I didn't do an exhaustive search for what might change, granted, but
OTOH the search was non-minimal.
>
>>
>> gdb compile failed, ../../../binutils-gdb/gdb/testsuite/gdb.mi/basics.c:32:1: warning: type
>> specifier missing, defaults to 'int' [-Wimplicit-int]
>> callee3 (char *strarg)
>> ^
>> ../../../binutils-gdb/gdb/testsuite/gdb.mi/basics.c:35:1: warning: control
>> reaches end of non-void function [-Wreturn-type]
>> }
>> ^
>> ...
>>
>> 2014-08-25 Doug Evans <dje@google.com>
>>
>> * gdb.mi/basics.c (callee3, callee2, callee1): Specify result type.
>> (main): Ditto.
>>
>> diff --git a/gdb/testsuite/gdb.mi/basics.c b/gdb/testsuite/gdb.mi/basics.c
>> index 0a4f9de..0eabcd1 100644
>> --- a/gdb/testsuite/gdb.mi/basics.c
>> +++ b/gdb/testsuite/gdb.mi/basics.c
>> @@ -29,17 +29,17 @@ int callee4 (void)
>> C = A + B;
>> return 0;
>> }
>> -callee3 (char *strarg)
>> +void callee3 (char *strarg)
>> {
>> callee4 ();
>> }
>>
>> -callee2 (int intarg, char *strarg)
>> +void callee2 (int intarg, char *strarg)
>> {
>> callee3 (strarg);
>> }
>>
>> -callee1 (int intarg, char *strarg, double fltarg)
>> +void callee1 (int intarg, char *strarg, double fltarg)
>> {
>> callee2 (intarg, strarg);
>> }
>> @@ -57,7 +57,7 @@ void do_nothing (void)
>> {
>> }
>>
>> -main ()
>> +int main ()
>> {
>> callee1 (2, "A string argument.", 3.5);
>> callee1 (2, "A string argument.", 3.5);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-25 21:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-25 19:44 [COMMITTED PATCH] Fix clang compilation errors in gdb.mi/basics.c Doug Evans
2014-08-25 21:39 ` Andrew Pinski
2014-08-25 21:57 ` Doug Evans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox