unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* suppressable byte compilation warnings and cconv.el
@ 2016-04-13 20:17 Paul Pogonyshev
  2016-04-14  1:35 ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Pogonyshev @ 2016-04-13 20:17 UTC (permalink / raw)
  To: emacs-devel

In file `bytecomp.el' there is a customizable variable
`byte-compile-warnings' that allows one to selectively silence certain
warnings. However, functions in `cconv.el' don't make use of that at
all, their warnings are unconditionally printed.

In particular, I'm annoyed by warnings like this:

    Warning: Unused lexical argument ‘size’

I can create a patch to make some warnings in `cconv.el' suppressable
too. Does that sound like a good idea?

Paul



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

* Re: suppressable byte compilation warnings and cconv.el
  2016-04-13 20:17 suppressable byte compilation warnings and cconv.el Paul Pogonyshev
@ 2016-04-14  1:35 ` Stefan Monnier
  2016-04-14  7:49   ` Paul Pogonyshev
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2016-04-14  1:35 UTC (permalink / raw)
  To: emacs-devel

> In file `bytecomp.el' there is a customizable variable
> `byte-compile-warnings' that allows one to selectively silence certain
> warnings.

I wouldn't use the word "selectively" to describe it.
It's extremely coarse only allowing you to control broad categories of
errors file-wide.

> In particular, I'm annoyed by warnings like this:
>     Warning: Unused lexical argument ‘size’

You can silence those (and yes, selectively this time) by prefixing the
variable name with an underscore, which makes it explicit that you know
the variable is not used.


        Stefan




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

* Re: suppressable byte compilation warnings and cconv.el
  2016-04-14  1:35 ` Stefan Monnier
@ 2016-04-14  7:49   ` Paul Pogonyshev
  2016-04-14  8:44     ` Paul Pogonyshev
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Pogonyshev @ 2016-04-14  7:49 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

> You can silence those (and yes, selectively this time) by prefixing the
> variable name with an underscore, which makes it explicit that you know
> the variable is not used.

Yes, I know about that, but that means you have to go about each
individual warning in every function. And remember to rename
parameters by adding/removing underscore when usage inside the
function changes. I'd like to also have the ability to silence all
such warnings altogether.

Paul

On 14 April 2016 at 03:35, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> In file `bytecomp.el' there is a customizable variable
>> `byte-compile-warnings' that allows one to selectively silence certain
>> warnings.
>
> I wouldn't use the word "selectively" to describe it.
> It's extremely coarse only allowing you to control broad categories of
> errors file-wide.
>
>> In particular, I'm annoyed by warnings like this:
>>     Warning: Unused lexical argument ‘size’
>
> You can silence those (and yes, selectively this time) by prefixing the
> variable name with an underscore, which makes it explicit that you know
> the variable is not used.
>
>
>         Stefan
>
>



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

* Re: suppressable byte compilation warnings and cconv.el
  2016-04-14  7:49   ` Paul Pogonyshev
@ 2016-04-14  8:44     ` Paul Pogonyshev
  2016-04-14 12:04       ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Pogonyshev @ 2016-04-14  8:44 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

To clarify why I want it.  I have some procedurally generated
functions, which I byte-compile after generation.  I would like to
avoid renaming attributes in the generator (not to mention the logic
needed to detect whether they are used), instead I'd just temporarily
suppress "unused x" warnings during this particular byte compilation.

Paul

On 14 April 2016 at 09:49, Paul Pogonyshev <pogonyshev@gmail.com> wrote:
>> You can silence those (and yes, selectively this time) by prefixing the
>> variable name with an underscore, which makes it explicit that you know
>> the variable is not used.
>
> Yes, I know about that, but that means you have to go about each
> individual warning in every function. And remember to rename
> parameters by adding/removing underscore when usage inside the
> function changes. I'd like to also have the ability to silence all
> such warnings altogether.
>
> Paul
>
> On 14 April 2016 at 03:35, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>>> In file `bytecomp.el' there is a customizable variable
>>> `byte-compile-warnings' that allows one to selectively silence certain
>>> warnings.
>>
>> I wouldn't use the word "selectively" to describe it.
>> It's extremely coarse only allowing you to control broad categories of
>> errors file-wide.
>>
>>> In particular, I'm annoyed by warnings like this:
>>>     Warning: Unused lexical argument ‘size’
>>
>> You can silence those (and yes, selectively this time) by prefixing the
>> variable name with an underscore, which makes it explicit that you know
>> the variable is not used.
>>
>>
>>         Stefan
>>
>>



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

* Re: suppressable byte compilation warnings and cconv.el
  2016-04-14  8:44     ` Paul Pogonyshev
@ 2016-04-14 12:04       ` Stefan Monnier
  2016-04-14 15:44         ` Paul Pogonyshev
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2016-04-14 12:04 UTC (permalink / raw)
  To: Paul Pogonyshev; +Cc: emacs-devel

> To clarify why I want it.  I have some procedurally generated
> functions, which I byte-compile after generation.

For those cases where you don't actually know whether it's used or not
(most typically this happens in macros), you can instead use the
`ignore' function:

   (defun foo (arg1 arg2)
     (ignore arg1 arg2)
     ...)


-- Stefan



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

* Re: suppressable byte compilation warnings and cconv.el
  2016-04-14 12:04       ` Stefan Monnier
@ 2016-04-14 15:44         ` Paul Pogonyshev
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Pogonyshev @ 2016-04-14 15:44 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

> For those cases where you don't actually know whether it's used or not
> (most typically this happens in macros), you can instead use the
> `ignore' function

OK, good enough for my usecase. Thank you.

Paul

On 14 April 2016 at 14:04, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> To clarify why I want it.  I have some procedurally generated
>> functions, which I byte-compile after generation.
>
> For those cases where you don't actually know whether it's used or not
> (most typically this happens in macros), you can instead use the
> `ignore' function:
>
>    (defun foo (arg1 arg2)
>      (ignore arg1 arg2)
>      ...)
>
>
> -- Stefan



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

end of thread, other threads:[~2016-04-14 15:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-13 20:17 suppressable byte compilation warnings and cconv.el Paul Pogonyshev
2016-04-14  1:35 ` Stefan Monnier
2016-04-14  7:49   ` Paul Pogonyshev
2016-04-14  8:44     ` Paul Pogonyshev
2016-04-14 12:04       ` Stefan Monnier
2016-04-14 15:44         ` Paul Pogonyshev

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).