[pushed,1/2] gdb: add ATTRIBUTE_NORETURN to remote_unpush_target

Message ID 20240716180642.2090972-1-simon.marchi@polymtl.ca
State New
Headers
Series [pushed,1/2] gdb: add ATTRIBUTE_NORETURN to remote_unpush_target |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply

Commit Message

Simon Marchi July 16, 2024, 6:06 p.m. UTC
  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

Lancelot SIX July 16, 2024, 7:38 p.m. UTC | #1
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
  
Simon Marchi July 16, 2024, 7:41 p.m. UTC | #2
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
  

Patch

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);