qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [4188] Fix compiler warnings
@ 2008-04-11  4:55 Aurelien Jarno
  2008-04-11  9:33 ` Fabrice Bellard
  0 siblings, 1 reply; 3+ messages in thread
From: Aurelien Jarno @ 2008-04-11  4:55 UTC (permalink / raw)
  To: qemu-devel

Revision: 4188
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4188
Author:   aurel32
Date:     2008-04-11 04:55:17 +0000 (Fri, 11 Apr 2008)

Log Message:
-----------
Fix compiler warnings

(Stefan Weil)

Modified Paths:
--------------
    trunk/cpu-exec.c

Modified: trunk/cpu-exec.c
===================================================================
--- trunk/cpu-exec.c	2008-04-11 04:55:07 UTC (rev 4187)
+++ trunk/cpu-exec.c	2008-04-11 04:55:17 UTC (rev 4188)
@@ -882,6 +882,8 @@
        do it (XXX: use sigsetjmp) */
     sigprocmask(SIG_SETMASK, old_set, NULL);
     cpu_loop_exit();
+    /* never comes here */
+    return 1;
 }
 #elif defined(TARGET_SPARC)
 static inline int handle_cpu_signal(unsigned long pc, unsigned long address,
@@ -918,6 +920,8 @@
        do it (XXX: use sigsetjmp) */
     sigprocmask(SIG_SETMASK, old_set, NULL);
     cpu_loop_exit();
+    /* never comes here */
+    return 1;
 }
 #elif defined (TARGET_PPC)
 static inline int handle_cpu_signal(unsigned long pc, unsigned long address,

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

* Re: [Qemu-devel] [4188] Fix compiler warnings
  2008-04-11  4:55 [Qemu-devel] [4188] Fix compiler warnings Aurelien Jarno
@ 2008-04-11  9:33 ` Fabrice Bellard
  2008-04-11 19:13   ` Stefan Weil
  0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Bellard @ 2008-04-11  9:33 UTC (permalink / raw)
  To: qemu-devel

It would be better to use the gcc noreturn function attribute !

Fabrice.

Aurelien Jarno wrote:
> Revision: 4188
>           http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4188
> Author:   aurel32
> Date:     2008-04-11 04:55:17 +0000 (Fri, 11 Apr 2008)
> 
> Log Message:
> -----------
> Fix compiler warnings
> 
> (Stefan Weil)
> 
> Modified Paths:
> --------------
>     trunk/cpu-exec.c
> 
> Modified: trunk/cpu-exec.c
> ===================================================================
> --- trunk/cpu-exec.c	2008-04-11 04:55:07 UTC (rev 4187)
> +++ trunk/cpu-exec.c	2008-04-11 04:55:17 UTC (rev 4188)
> @@ -882,6 +882,8 @@
>         do it (XXX: use sigsetjmp) */
>      sigprocmask(SIG_SETMASK, old_set, NULL);
>      cpu_loop_exit();
> +    /* never comes here */
> +    return 1;
>  }
>  #elif defined(TARGET_SPARC)
>  static inline int handle_cpu_signal(unsigned long pc, unsigned long address,
> @@ -918,6 +920,8 @@
>         do it (XXX: use sigsetjmp) */
>      sigprocmask(SIG_SETMASK, old_set, NULL);
>      cpu_loop_exit();
> +    /* never comes here */
> +    return 1;
>  }
>  #elif defined (TARGET_PPC)
>  static inline int handle_cpu_signal(unsigned long pc, unsigned long address,
> 
> 
> 
> 
> 

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

* Re: [Qemu-devel] [4188] Fix compiler warnings
  2008-04-11  9:33 ` Fabrice Bellard
@ 2008-04-11 19:13   ` Stefan Weil
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Weil @ 2008-04-11 19:13 UTC (permalink / raw)
  To: qemu-devel

In this special case, this is not possible without some dirty tricks:

The attribute must be assigned to cpu_loop_exit.
cpu_loop_exit would no longer end with an assembler return, so dyngen 
will fail.

Maybe my dummy return is the better solution for the moment
Several architectures used this solution before my patch.

Stefan

Fabrice Bellard schrieb:
> It would be better to use the gcc noreturn function attribute !
>
> Fabrice.
>
> Aurelien Jarno wrote:
>> Revision: 4188
>>           http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4188
>> Author:   aurel32
>> Date:     2008-04-11 04:55:17 +0000 (Fri, 11 Apr 2008)
>>
>> Log Message:
>> -----------
>> Fix compiler warnings
>>
>> (Stefan Weil)
>>
>> Modified Paths:
>> --------------
>>     trunk/cpu-exec.c
>>
>> Modified: trunk/cpu-exec.c
>> ===================================================================
>> --- trunk/cpu-exec.c    2008-04-11 04:55:07 UTC (rev 4187)
>> +++ trunk/cpu-exec.c    2008-04-11 04:55:17 UTC (rev 4188)
>> @@ -882,6 +882,8 @@
>>         do it (XXX: use sigsetjmp) */
>>      sigprocmask(SIG_SETMASK, old_set, NULL);
>>      cpu_loop_exit();
>> +    /* never comes here */
>> +    return 1;
>>  }
>>  #elif defined(TARGET_SPARC)
>>  static inline int handle_cpu_signal(unsigned long pc, unsigned long 
>> address,
>> @@ -918,6 +920,8 @@
>>         do it (XXX: use sigsetjmp) */
>>      sigprocmask(SIG_SETMASK, old_set, NULL);
>>      cpu_loop_exit();
>> +    /* never comes here */
>> +    return 1;
>>  }
>>  #elif defined (TARGET_PPC)
>>  static inline int handle_cpu_signal(unsigned long pc, unsigned long 
>> address,
>>
>>
>>
>>
>>
>
>
>
>

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

end of thread, other threads:[~2008-04-11 19:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-11  4:55 [Qemu-devel] [4188] Fix compiler warnings Aurelien Jarno
2008-04-11  9:33 ` Fabrice Bellard
2008-04-11 19:13   ` Stefan Weil

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 NNTP newsgroup(s).