All of lore.kernel.org
 help / color / mirror / Atom feed
* unset_dumpable
@ 2017-07-20 14:02 Willem Jan Withagen
  2017-07-20 19:20 ` unset_dumpable Patrick Donnelly
  0 siblings, 1 reply; 6+ messages in thread
From: Willem Jan Withagen @ 2017-07-20 14:02 UTC (permalink / raw)
  To: Ceph Development

Hi,

I'm running in too many:
/home/jenkins/workspace/ceph-master/src/test/bufferlist.cc:490:11:
warning: unused variable 'unset_dumpable' [-Wunused-variable]
    PrCtl unset_dumpable;
          ^

for it to be by accident??
But why is this variable created in about a dozen functions?

--WjW

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

* Re: unset_dumpable
  2017-07-20 14:02 unset_dumpable Willem Jan Withagen
@ 2017-07-20 19:20 ` Patrick Donnelly
  2017-07-20 20:06   ` unset_dumpable Willem Jan Withagen
  0 siblings, 1 reply; 6+ messages in thread
From: Patrick Donnelly @ 2017-07-20 19:20 UTC (permalink / raw)
  To: Willem Jan Withagen; +Cc: Ceph Development, Brad Hubbard

On Thu, Jul 20, 2017 at 7:02 AM, Willem Jan Withagen <wjw@digiware.nl> wrote:
> Hi,
>
> I'm running in too many:
> /home/jenkins/workspace/ceph-master/src/test/bufferlist.cc:490:11:
> warning: unused variable 'unset_dumpable' [-Wunused-variable]
>     PrCtl unset_dumpable;
>           ^
>
> for it to be by accident??
> But why is this variable created in about a dozen functions?

AFAICT, the intent by Brad in aef2a7b6ac5d0dafdac16d0d4cef42056c07b5a6
is to prevent core dumps during the lifetime of certain objects. The
object is actually used indirectly via syscalls in its
constructo/destructor.

Is there a nice way of silencing this warning for this code?

-- 
Patrick Donnelly

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

* Re: unset_dumpable
  2017-07-20 19:20 ` unset_dumpable Patrick Donnelly
@ 2017-07-20 20:06   ` Willem Jan Withagen
  2017-07-20 21:04     ` unset_dumpable Willem Jan Withagen
  0 siblings, 1 reply; 6+ messages in thread
From: Willem Jan Withagen @ 2017-07-20 20:06 UTC (permalink / raw)
  To: Patrick Donnelly; +Cc: Ceph Development, Brad Hubbard



Op 20-7-2017 om 21:20 schreef Patrick Donnelly:
> On Thu, Jul 20, 2017 at 7:02 AM, Willem Jan Withagen <wjw@digiware.nl> wrote:
>> Hi,
>>
>> I'm running in too many:
>> /home/jenkins/workspace/ceph-master/src/test/bufferlist.cc:490:11:
>> warning: unused variable 'unset_dumpable' [-Wunused-variable]
>>      PrCtl unset_dumpable;
>>            ^
>>
>> for it to be by accident??
>> But why is this variable created in about a dozen functions?
> AFAICT, the intent by Brad in aef2a7b6ac5d0dafdac16d0d4cef42056c07b5a6
> is to prevent core dumps during the lifetime of certain objects. The
> object is actually used indirectly via syscalls in its
> constructo/destructor.
>
> Is there a nice way of silencing this warning for this code?
I suspected as much as that.

Likely there is a pragma that can be wrapped around the declaration.
And then stick it in a macro, but I'm not sure that pragma will survice 
a macro.

--WjW
>


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

* Re: unset_dumpable
  2017-07-20 20:06   ` unset_dumpable Willem Jan Withagen
@ 2017-07-20 21:04     ` Willem Jan Withagen
  2017-07-20 22:39       ` unset_dumpable Brad Hubbard
  0 siblings, 1 reply; 6+ messages in thread
From: Willem Jan Withagen @ 2017-07-20 21:04 UTC (permalink / raw)
  To: Patrick Donnelly; +Cc: Ceph Development, Brad Hubbard

Op 20-7-2017 om 22:06 schreef Willem Jan Withagen:
>
>
> Op 20-7-2017 om 21:20 schreef Patrick Donnelly:
>> On Thu, Jul 20, 2017 at 7:02 AM, Willem Jan Withagen 
>> <wjw@digiware.nl> wrote:
>>> Hi,
>>>
>>> I'm running in too many:
>>> /home/jenkins/workspace/ceph-master/src/test/bufferlist.cc:490:11:
>>> warning: unused variable 'unset_dumpable' [-Wunused-variable]
>>>      PrCtl unset_dumpable;
>>>            ^
>>>
>>> for it to be by accident??
>>> But why is this variable created in about a dozen functions?
>> AFAICT, the intent by Brad in aef2a7b6ac5d0dafdac16d0d4cef42056c07b5a6
>> is to prevent core dumps during the lifetime of certain objects. The
>> object is actually used indirectly via syscalls in its
>> constructo/destructor.
>>
>> Is there a nice way of silencing this warning for this code?
> I suspected as much as that.
>
> Likely there is a pragma that can be wrapped around the declaration.
> And then stick it in a macro, but I'm not sure that pragma will 
> survice a macro. 

Pragmas could work, but sticking them in a macro for both GCC and Clang 
is a real mess.
Doing a (void) trick seems a lot easier.

     https://github.com/ceph/ceph/pull/16462

--WjW

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

* Re: unset_dumpable
  2017-07-20 21:04     ` unset_dumpable Willem Jan Withagen
@ 2017-07-20 22:39       ` Brad Hubbard
  2017-07-20 23:34         ` unset_dumpable Willem Jan Withagen
  0 siblings, 1 reply; 6+ messages in thread
From: Brad Hubbard @ 2017-07-20 22:39 UTC (permalink / raw)
  To: Willem Jan Withagen; +Cc: Patrick Donnelly, Ceph Development

When implemented it was generally though to be OK by reviewers, including yourself.

https://github.com/ceph/ceph/pull/14821

Can I asked what changed to make it an issue now? Has there been some recent
change in compilers on FreeBSD to make this an issue? It's a valid use of RAII
in my humble opinion although it *appears* to be an unused variable. Odd this
warning is not present on Linux and I wonder whether sanity prevailed in that
regard?

On Fri, Jul 21, 2017 at 7:04 AM, Willem Jan Withagen <wjw@digiware.nl> wrote:
> Op 20-7-2017 om 22:06 schreef Willem Jan Withagen:
>>
>>
>>
>> Op 20-7-2017 om 21:20 schreef Patrick Donnelly:
>>>
>>> On Thu, Jul 20, 2017 at 7:02 AM, Willem Jan Withagen <wjw@digiware.nl>
>>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I'm running in too many:
>>>> /home/jenkins/workspace/ceph-master/src/test/bufferlist.cc:490:11:
>>>> warning: unused variable 'unset_dumpable' [-Wunused-variable]
>>>>      PrCtl unset_dumpable;
>>>>            ^
>>>>
>>>> for it to be by accident??
>>>> But why is this variable created in about a dozen functions?
>>>
>>> AFAICT, the intent by Brad in aef2a7b6ac5d0dafdac16d0d4cef42056c07b5a6
>>> is to prevent core dumps during the lifetime of certain objects. The
>>> object is actually used indirectly via syscalls in its
>>> constructo/destructor.
>>>
>>> Is there a nice way of silencing this warning for this code?
>>
>> I suspected as much as that.
>>
>> Likely there is a pragma that can be wrapped around the declaration.
>> And then stick it in a macro, but I'm not sure that pragma will survice a
>> macro.
>
>
> Pragmas could work, but sticking them in a macro for both GCC and Clang is a
> real mess.
> Doing a (void) trick seems a lot easier.
>
>     https://github.com/ceph/ceph/pull/16462
>
> --WjW



-- 
Cheers,
Brad

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

* Re: unset_dumpable
  2017-07-20 22:39       ` unset_dumpable Brad Hubbard
@ 2017-07-20 23:34         ` Willem Jan Withagen
  0 siblings, 0 replies; 6+ messages in thread
From: Willem Jan Withagen @ 2017-07-20 23:34 UTC (permalink / raw)
  To: Brad Hubbard; +Cc: Patrick Donnelly, Ceph Development



Op 21-7-2017 om 00:39 schreef Brad Hubbard:
> When implemented it was generally though to be OK by reviewers, including yourself.
>
> https://github.com/ceph/ceph/pull/14821
>
> Can I asked what changed to make it an issue now? Has there been some recent
> change in compilers on FreeBSD to make this an issue? It's a valid use of RAII
> in my humble opinion although it *appears* to be an unused variable. Odd this
> warning is not present on Linux and I wonder whether sanity prevailed in that
> regard?

At that time I only looked at the functionality of your code, and was 
happy with what it did.
Which is still the case.

But I'm also trying to get as little warnings as possible, since that 
will new ones more outstanding.
And unused variables usually trigger my eye, because that is mostly 
caused by conditionals.
And I;ve already put in a large amount  FreeBSD depends, quite a few 
caused warnings and needed
some TLC.

I have no opinion as to the sanity of hte compiler makers, and 
where//what warnings they assert.

--WjW

>
> On Fri, Jul 21, 2017 at 7:04 AM, Willem Jan Withagen <wjw@digiware.nl> wrote:
>> Op 20-7-2017 om 22:06 schreef Willem Jan Withagen:
>>>
>>>
>>> Op 20-7-2017 om 21:20 schreef Patrick Donnelly:
>>>> On Thu, Jul 20, 2017 at 7:02 AM, Willem Jan Withagen <wjw@digiware.nl>
>>>> wrote:
>>>>> Hi,
>>>>>
>>>>> I'm running in too many:
>>>>> /home/jenkins/workspace/ceph-master/src/test/bufferlist.cc:490:11:
>>>>> warning: unused variable 'unset_dumpable' [-Wunused-variable]
>>>>>       PrCtl unset_dumpable;
>>>>>             ^
>>>>>
>>>>> for it to be by accident??
>>>>> But why is this variable created in about a dozen functions?
>>>> AFAICT, the intent by Brad in aef2a7b6ac5d0dafdac16d0d4cef42056c07b5a6
>>>> is to prevent core dumps during the lifetime of certain objects. The
>>>> object is actually used indirectly via syscalls in its
>>>> constructo/destructor.
>>>>
>>>> Is there a nice way of silencing this warning for this code?
>>> I suspected as much as that.
>>>
>>> Likely there is a pragma that can be wrapped around the declaration.
>>> And then stick it in a macro, but I'm not sure that pragma will survice a
>>> macro.
>>
>> Pragmas could work, but sticking them in a macro for both GCC and Clang is a
>> real mess.
>> Doing a (void) trick seems a lot easier.
>>
>>      https://github.com/ceph/ceph/pull/16462
>>
>> --WjW
>
>


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

end of thread, other threads:[~2017-07-20 23:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-20 14:02 unset_dumpable Willem Jan Withagen
2017-07-20 19:20 ` unset_dumpable Patrick Donnelly
2017-07-20 20:06   ` unset_dumpable Willem Jan Withagen
2017-07-20 21:04     ` unset_dumpable Willem Jan Withagen
2017-07-20 22:39       ` unset_dumpable Brad Hubbard
2017-07-20 23:34         ` unset_dumpable Willem Jan Withagen

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.