* [PATCH-for-8.0] qemu/osdep.h: Do not declare function prototypes using extern keyword
@ 2023-03-20 13:14 Philippe Mathieu-Daudé
2023-03-20 13:27 ` Daniel P. Berrangé
0 siblings, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-03-20 13:14 UTC (permalink / raw)
To: qemu-devel
Cc: Daniel P . Berrange, Sebastian Wilhelmi, Eric Blake,
Sebastian Wilhelmi, Philippe Mathieu-Daudé,
Simon Wörner
By default, C function prototypes declared in headers are visible,
so there is no need to declare them as 'extern' functions. Remove
this redundancy. This also fixes when building under MSYS2:
C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:1075:21: error: standard attributes in middle of decl-specifiers
1075 | # define G_NORETURN [[noreturn]]
| ^
C:/msys64/code/qemu/src/include/qemu/osdep.h:240:8: note: in expansion of macro 'G_NORETURN'
240 | extern G_NORETURN
| ^~~~~~~~~~
Reported-by: Simon Wörner <contact@simon-woerner.de>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1541
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/qemu/osdep.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index f68b5d8708..79c26c748a 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -237,7 +237,7 @@ extern "C" {
* supports QEMU_ERROR, this will be reported at compile time; otherwise
* this will be reported at link time due to the missing symbol.
*/
-extern G_NORETURN
+G_NORETURN
void QEMU_ERROR("code path is reachable")
qemu_build_not_reached_always(void);
#if defined(__OPTIMIZE__) && !defined(__NO_INLINE__)
--
2.38.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH-for-8.0] qemu/osdep.h: Do not declare function prototypes using extern keyword
2023-03-20 13:14 [PATCH-for-8.0] qemu/osdep.h: Do not declare function prototypes using extern keyword Philippe Mathieu-Daudé
@ 2023-03-20 13:27 ` Daniel P. Berrangé
2023-03-20 13:47 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 5+ messages in thread
From: Daniel P. Berrangé @ 2023-03-20 13:27 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Sebastian Wilhelmi, Eric Blake, Sebastian Wilhelmi,
Simon Wörner
On Mon, Mar 20, 2023 at 02:14:26PM +0100, Philippe Mathieu-Daudé wrote:
> By default, C function prototypes declared in headers are visible,
> so there is no need to declare them as 'extern' functions. Remove
> this redundancy. This also fixes when building under MSYS2:
>
> C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:1075:21: error: standard attributes in middle of decl-specifiers
> 1075 | # define G_NORETURN [[noreturn]]
> | ^
> C:/msys64/code/qemu/src/include/qemu/osdep.h:240:8: note: in expansion of macro 'G_NORETURN'
> 240 | extern G_NORETURN
> | ^~~~~~~~~~
>
> Reported-by: Simon Wörner <contact@simon-woerner.de>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1541
There's already a fix for that issue included in a PULL request from
Thomas:
https://lists.gnu.org/archive/html/qemu-devel/2023-03/msg05225.html
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> include/qemu/osdep.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
> index f68b5d8708..79c26c748a 100644
> --- a/include/qemu/osdep.h
> +++ b/include/qemu/osdep.h
> @@ -237,7 +237,7 @@ extern "C" {
> * supports QEMU_ERROR, this will be reported at compile time; otherwise
> * this will be reported at link time due to the missing symbol.
> */
> -extern G_NORETURN
> +G_NORETURN
> void QEMU_ERROR("code path is reachable")
> qemu_build_not_reached_always(void);
> #if defined(__OPTIMIZE__) && !defined(__NO_INLINE__)
> --
> 2.38.1
>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH-for-8.0] qemu/osdep.h: Do not declare function prototypes using extern keyword
2023-03-20 13:27 ` Daniel P. Berrangé
@ 2023-03-20 13:47 ` Philippe Mathieu-Daudé
2023-03-20 14:04 ` Thomas Huth
0 siblings, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-03-20 13:47 UTC (permalink / raw)
To: Daniel P. Berrangé, Thomas Huth
Cc: qemu-devel, Sebastian Wilhelmi, Eric Blake, Sebastian Wilhelmi,
Simon Wörner
On 20/3/23 14:27, Daniel P. Berrangé wrote:
> On Mon, Mar 20, 2023 at 02:14:26PM +0100, Philippe Mathieu-Daudé wrote:
>> By default, C function prototypes declared in headers are visible,
>> so there is no need to declare them as 'extern' functions. Remove
>> this redundancy. This also fixes when building under MSYS2:
>>
>> C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:1075:21: error: standard attributes in middle of decl-specifiers
>> 1075 | # define G_NORETURN [[noreturn]]
>> | ^
>> C:/msys64/code/qemu/src/include/qemu/osdep.h:240:8: note: in expansion of macro 'G_NORETURN'
>> 240 | extern G_NORETURN
>> | ^~~~~~~~~~
>>
>> Reported-by: Simon Wörner <contact@simon-woerner.de>
>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1541
>
> There's already a fix for that issue included in a PULL request from
> Thomas:
>
> https://lists.gnu.org/archive/html/qemu-devel/2023-03/msg05225.html
Not the same patch. I'll rebase and post for 8.1 then I guess :)
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> include/qemu/osdep.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
>> index f68b5d8708..79c26c748a 100644
>> --- a/include/qemu/osdep.h
>> +++ b/include/qemu/osdep.h
>> @@ -237,7 +237,7 @@ extern "C" {
>> * supports QEMU_ERROR, this will be reported at compile time; otherwise
>> * this will be reported at link time due to the missing symbol.
>> */
>> -extern G_NORETURN
>> +G_NORETURN
>> void QEMU_ERROR("code path is reachable")
>> qemu_build_not_reached_always(void);
>> #if defined(__OPTIMIZE__) && !defined(__NO_INLINE__)
>> --
>> 2.38.1
>>
>
> With regards,
> Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH-for-8.0] qemu/osdep.h: Do not declare function prototypes using extern keyword
2023-03-20 13:47 ` Philippe Mathieu-Daudé
@ 2023-03-20 14:04 ` Thomas Huth
2023-03-20 14:24 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2023-03-20 14:04 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, Daniel P. Berrangé
Cc: qemu-devel, Sebastian Wilhelmi, Eric Blake, Sebastian Wilhelmi,
Simon Wörner, Bernhard Beschow
On 20/03/2023 14.47, Philippe Mathieu-Daudé wrote:
> On 20/3/23 14:27, Daniel P. Berrangé wrote:
>> On Mon, Mar 20, 2023 at 02:14:26PM +0100, Philippe Mathieu-Daudé wrote:
>>> By default, C function prototypes declared in headers are visible,
>>> so there is no need to declare them as 'extern' functions. Remove
>>> this redundancy. This also fixes when building under MSYS2:
>>>
>>> C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:1075:21: error:
>>> standard attributes in middle of decl-specifiers
>>> 1075 | # define G_NORETURN [[noreturn]]
>>> | ^
>>> C:/msys64/code/qemu/src/include/qemu/osdep.h:240:8: note: in expansion
>>> of macro 'G_NORETURN'
>>> 240 | extern G_NORETURN
>>> | ^~~~~~~~~~
>>>
>>> Reported-by: Simon Wörner <contact@simon-woerner.de>
>>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1541
>>
>> There's already a fix for that issue included in a PULL request from
>> Thomas:
>>
>> https://lists.gnu.org/archive/html/qemu-devel/2023-03/msg05225.html
>
> Not the same patch. I'll rebase and post for 8.1 then I guess :)
>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> ---
>>> include/qemu/osdep.h | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
>>> index f68b5d8708..79c26c748a 100644
>>> --- a/include/qemu/osdep.h
>>> +++ b/include/qemu/osdep.h
>>> @@ -237,7 +237,7 @@ extern "C" {
>>> * supports QEMU_ERROR, this will be reported at compile time; otherwise
>>> * this will be reported at link time due to the missing symbol.
>>> */
>>> -extern G_NORETURN
>>> +G_NORETURN
Removing the "extern" sounds like a better idea than swapping it... since my
PR was not in the staging branch yet, I went ahead and replaced the patch.
Thomas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH-for-8.0] qemu/osdep.h: Do not declare function prototypes using extern keyword
2023-03-20 14:04 ` Thomas Huth
@ 2023-03-20 14:24 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-03-20 14:24 UTC (permalink / raw)
To: Thomas Huth, Daniel P. Berrangé
Cc: qemu-devel, Sebastian Wilhelmi, Eric Blake, Sebastian Wilhelmi,
Simon Wörner, Bernhard Beschow
On 20/3/23 15:04, Thomas Huth wrote:
> On 20/03/2023 14.47, Philippe Mathieu-Daudé wrote:
>> On 20/3/23 14:27, Daniel P. Berrangé wrote:
>>> On Mon, Mar 20, 2023 at 02:14:26PM +0100, Philippe Mathieu-Daudé wrote:
>>>> By default, C function prototypes declared in headers are visible,
>>>> so there is no need to declare them as 'extern' functions. Remove
>>>> this redundancy. This also fixes when building under MSYS2:
>>>>
>>>> C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:1075:21: error:
>>>> standard attributes in middle of decl-specifiers
>>>> 1075 | # define G_NORETURN [[noreturn]]
>>>> | ^
>>>> C:/msys64/code/qemu/src/include/qemu/osdep.h:240:8: note: in
>>>> expansion of macro 'G_NORETURN'
>>>> 240 | extern G_NORETURN
>>>> | ^~~~~~~~~~
>>>>
>>>> Reported-by: Simon Wörner <contact@simon-woerner.de>
>>>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1541
>>>
>>> There's already a fix for that issue included in a PULL request from
>>> Thomas:
>>>
>>> https://lists.gnu.org/archive/html/qemu-devel/2023-03/msg05225.html
>>
>> Not the same patch. I'll rebase and post for 8.1 then I guess :)
>>
>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>> ---
>>>> include/qemu/osdep.h | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
>>>> index f68b5d8708..79c26c748a 100644
>>>> --- a/include/qemu/osdep.h
>>>> +++ b/include/qemu/osdep.h
>>>> @@ -237,7 +237,7 @@ extern "C" {
>>>> * supports QEMU_ERROR, this will be reported at compile time;
>>>> otherwise
>>>> * this will be reported at link time due to the missing symbol.
>>>> */
>>>> -extern G_NORETURN
>>>> +G_NORETURN
>
> Removing the "extern" sounds like a better idea than swapping it...
> since my PR was not in the staging branch yet, I went ahead and replaced
> the patch.
Thank you!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-03-20 14:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-20 13:14 [PATCH-for-8.0] qemu/osdep.h: Do not declare function prototypes using extern keyword Philippe Mathieu-Daudé
2023-03-20 13:27 ` Daniel P. Berrangé
2023-03-20 13:47 ` Philippe Mathieu-Daudé
2023-03-20 14:04 ` Thomas Huth
2023-03-20 14:24 ` Philippe Mathieu-Daudé
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.