Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] [gdb/build] Fix unused var in corelow.c
@ 2024-09-09  4:19 Tom de Vries
  2024-09-09 13:35 ` Lancelot SIX
  0 siblings, 1 reply; 3+ messages in thread
From: Tom de Vries @ 2024-09-09  4:19 UTC (permalink / raw)
  To: gdb-patches

On x86_64-linux, with gcc 7.5.0 and CFLAGS/CXXFLAGS="-O0 -g -Wall" I ran into
a build breaker:
...
gdb/corelow.c: In member function ‘void mapped_file_info::add(const char*, const char*, const char*, std::vector<mem_range>&&, const bfd_build_id*)’:
gdb/corelow.c:1822:27: error: unused variable ‘it’ [-Werror=unused-variable]
   const auto [it, inserted]
                           ^
...

Fix this by dropping the variable it.

Tested on x86_64-linux.
---
 gdb/corelow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/corelow.c b/gdb/corelow.c
index 16f07c23faa..ab2fa746de8 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -1819,8 +1819,8 @@ mapped_file_info::add (const char *soname,
      parsed, we group the build-id information based on the file name.  As
      a consequence, we should see each EXPECTED_FILENAME value exactly
      once.  This means that each insertion should always succeed.  */
-  const auto [it, inserted]
-    = m_filename_to_build_id_map.emplace (expected_filename, build_id);
+  const auto inserted
+    = m_filename_to_build_id_map.emplace (expected_filename, build_id).second;
   gdb_assert (inserted);
 
   /* Setup the reverse build-id to file name map.  */

base-commit: 29c70787112e01cd52b53bf14bdcacb0a11e0725
-- 
2.35.3


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

* Re: [PATCH] [gdb/build] Fix unused var in corelow.c
  2024-09-09  4:19 [PATCH] [gdb/build] Fix unused var in corelow.c Tom de Vries
@ 2024-09-09 13:35 ` Lancelot SIX
  2024-09-10  8:09   ` Tom de Vries
  0 siblings, 1 reply; 3+ messages in thread
From: Lancelot SIX @ 2024-09-09 13:35 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gdb-patches

Hi,

FYI, I see the same issue on a CI system.

FWIW, the patch looks good to me.

Reviewed-By: Lancelot Six<lancelot.six@amd.com>

Best,
Lancelot.

On Mon, Sep 09, 2024 at 06:19:13AM +0200, Tom de Vries wrote:
> On x86_64-linux, with gcc 7.5.0 and CFLAGS/CXXFLAGS="-O0 -g -Wall" I ran into
> a build breaker:
> ...
> gdb/corelow.c: In member function ‘void mapped_file_info::add(const char*, const char*, const char*, std::vector<mem_range>&&, const bfd_build_id*)’:
> gdb/corelow.c:1822:27: error: unused variable ‘it’ [-Werror=unused-variable]
>    const auto [it, inserted]
>                            ^
> ...
> 
> Fix this by dropping the variable it.
> 
> Tested on x86_64-linux.
> ---
>  gdb/corelow.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/corelow.c b/gdb/corelow.c
> index 16f07c23faa..ab2fa746de8 100644
> --- a/gdb/corelow.c
> +++ b/gdb/corelow.c
> @@ -1819,8 +1819,8 @@ mapped_file_info::add (const char *soname,
>       parsed, we group the build-id information based on the file name.  As
>       a consequence, we should see each EXPECTED_FILENAME value exactly
>       once.  This means that each insertion should always succeed.  */
> -  const auto [it, inserted]
> -    = m_filename_to_build_id_map.emplace (expected_filename, build_id);
> +  const auto inserted
> +    = m_filename_to_build_id_map.emplace (expected_filename, build_id).second;
>    gdb_assert (inserted);
>  
>    /* Setup the reverse build-id to file name map.  */
> 
> base-commit: 29c70787112e01cd52b53bf14bdcacb0a11e0725
> -- 
> 2.35.3
> 

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

* Re: [PATCH] [gdb/build] Fix unused var in corelow.c
  2024-09-09 13:35 ` Lancelot SIX
@ 2024-09-10  8:09   ` Tom de Vries
  0 siblings, 0 replies; 3+ messages in thread
From: Tom de Vries @ 2024-09-10  8:09 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

On 9/9/24 15:35, Lancelot SIX wrote:
> Hi,
> 
> FYI, I see the same issue on a CI system.
> 
> FWIW, the patch looks good to me.
> 

Hi Lancelot,

thanks for the review, pushed.

- Tom

> Reviewed-By: Lancelot Six<lancelot.six@amd.com>
> 
> Best,
> Lancelot.
> 
> On Mon, Sep 09, 2024 at 06:19:13AM +0200, Tom de Vries wrote:
>> On x86_64-linux, with gcc 7.5.0 and CFLAGS/CXXFLAGS="-O0 -g -Wall" I ran into
>> a build breaker:
>> ...
>> gdb/corelow.c: In member function ‘void mapped_file_info::add(const char*, const char*, const char*, std::vector<mem_range>&&, const bfd_build_id*)’:
>> gdb/corelow.c:1822:27: error: unused variable ‘it’ [-Werror=unused-variable]
>>     const auto [it, inserted]
>>                             ^
>> ...
>>
>> Fix this by dropping the variable it.
>>
>> Tested on x86_64-linux.
>> ---
>>   gdb/corelow.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/gdb/corelow.c b/gdb/corelow.c
>> index 16f07c23faa..ab2fa746de8 100644
>> --- a/gdb/corelow.c
>> +++ b/gdb/corelow.c
>> @@ -1819,8 +1819,8 @@ mapped_file_info::add (const char *soname,
>>        parsed, we group the build-id information based on the file name.  As
>>        a consequence, we should see each EXPECTED_FILENAME value exactly
>>        once.  This means that each insertion should always succeed.  */
>> -  const auto [it, inserted]
>> -    = m_filename_to_build_id_map.emplace (expected_filename, build_id);
>> +  const auto inserted
>> +    = m_filename_to_build_id_map.emplace (expected_filename, build_id).second;
>>     gdb_assert (inserted);
>>   
>>     /* Setup the reverse build-id to file name map.  */
>>
>> base-commit: 29c70787112e01cd52b53bf14bdcacb0a11e0725
>> -- 
>> 2.35.3
>>


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

end of thread, other threads:[~2024-09-10  8:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-09  4:19 [PATCH] [gdb/build] Fix unused var in corelow.c Tom de Vries
2024-09-09 13:35 ` Lancelot SIX
2024-09-10  8:09   ` Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox