[pushed,1/2] gdb: add ATTRIBUTE_NORETURN to remote_unpush_target
Checks
Commit Message
My IDE (well, clangd) suggested this. It doesn't hurt to have it.
Change-Id: If6001983c17dbed3dceebac3078c8deb12c04d6b
---
gdb/remote.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
base-commit: b6a5604da00b0438a0fb9b93e8713b14f323b6e4
Comments
On 16/07/2024 19:06, Simon Marchi wrote:
> My IDE (well, clangd) suggested this. It doesn't hurt to have it.
>
> Change-Id: If6001983c17dbed3dceebac3078c8deb12c04d6b
> ---
> gdb/remote.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gdb/remote.c b/gdb/remote.c
> index 188795d19035..8a693df48183 100644
> --- a/gdb/remote.c
> +++ b/gdb/remote.c
> @@ -6150,7 +6150,7 @@ remote_unpush_target (remote_target *target)
> fileio_handles_invalidate_target (target);
> }
>
> -static void
> +static void ATTRIBUTE_NORETURN
> remote_unpush_and_throw (remote_target *target)
> {
> remote_unpush_target (target);
Hi Simon,
Could it make sense to have used c++11’s [[noreturn]] instead?
Lancelot.
>
> base-commit: b6a5604da00b0438a0fb9b93e8713b14f323b6e4
On 2024-07-16 15:38, Lancelot SIX wrote:
>
> On 16/07/2024 19:06, Simon Marchi wrote:
>> My IDE (well, clangd) suggested this. It doesn't hurt to have it.
>>
>> Change-Id: If6001983c17dbed3dceebac3078c8deb12c04d6b
>> ---
>> gdb/remote.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/gdb/remote.c b/gdb/remote.c
>> index 188795d19035..8a693df48183 100644
>> --- a/gdb/remote.c
>> +++ b/gdb/remote.c
>> @@ -6150,7 +6150,7 @@ remote_unpush_target (remote_target *target)
>> fileio_handles_invalidate_target (target);
>> }
>> -static void
>> +static void ATTRIBUTE_NORETURN
>> remote_unpush_and_throw (remote_target *target)
>> {
>> remote_unpush_target (target);
>
> Hi Simon,
>
> Could it make sense to have used c++11’s [[noreturn]] instead?
Yes, but in this case I'll make a patch to change all uses of
ATTRIBUTE_NORETURN in our code base, so we don't have a mixed style.
Simon
@@ -6150,7 +6150,7 @@ remote_unpush_target (remote_target *target)
fileio_handles_invalidate_target (target);
}
-static void
+static void ATTRIBUTE_NORETURN
remote_unpush_and_throw (remote_target *target)
{
remote_unpush_target (target);