all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* _GL_UNUSED
@ 2014-03-26  1:02 Juanma Barranquero
  2014-03-26  1:22 ` _GL_UNUSED Paul Eggert
  0 siblings, 1 reply; 7+ messages in thread
From: Juanma Barranquero @ 2014-03-26  1:02 UTC (permalink / raw)
  To: Emacs developers

Compiling Emacs on Windows with full warnings generates almost 300
"unused parameter" warnings. Of those, ~180 are really unused (the
rest are used in non-Windows sections of code), and could be silenced
by using _GL_UNUSED.

It's OK to use _GL_UNUSED in the sources, or there's some preference
not to use it for some reason?

    J



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

* Re: _GL_UNUSED
  2014-03-26  1:02 _GL_UNUSED Juanma Barranquero
@ 2014-03-26  1:22 ` Paul Eggert
  2014-03-26  1:39   ` _GL_UNUSED Juanma Barranquero
  2014-03-26  3:57   ` _GL_UNUSED Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Paul Eggert @ 2014-03-26  1:22 UTC (permalink / raw)
  To: Juanma Barranquero, Emacs developers

Juanma Barranquero wrote:
> It's OK to use _GL_UNUSED in the sources, or there's some preference
> not to use it for some reason?

The typical practice is to configure with --enable-gcc-warnings. 
Turning on all GCC warnings can cause more trouble than it cures. 
Selectively silencing them with the likes of _GL_UNUSED can clutter the 
code particularly in the presence of ifdefs; I've tried to do that sort 
of thing only for warnings where the benefits are worth the costs.

Admittedly this is often a judgment call.  If --enable-gcc-warnings 
isn't enabling a diagnostic that would be useful for Emacs development, 
then we can change it so that it does.



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

* Re: _GL_UNUSED
  2014-03-26  1:22 ` _GL_UNUSED Paul Eggert
@ 2014-03-26  1:39   ` Juanma Barranquero
  2014-03-26  3:57   ` _GL_UNUSED Eli Zaretskii
  1 sibling, 0 replies; 7+ messages in thread
From: Juanma Barranquero @ 2014-03-26  1:39 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Emacs developers

On Wed, Mar 26, 2014 at 2:22 AM, Paul Eggert <eggert@cs.ucla.edu> wrote:

> The typical practice is to configure with --enable-gcc-warnings. Turning on
> all GCC warnings can cause more trouble than it cures.

Let's not discuss the philosophy behind enabling all warnings, please.
I do it because I find it useful, but Y(or anyone else's)MMV.

> Selectively silencing
> them with the likes of _GL_UNUSED can clutter the code particularly in the
> presence of ifdefs;

OK, I suppose there's a preference for not adding it, then.

Thanks,

    J



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

* Re: _GL_UNUSED
  2014-03-26  1:22 ` _GL_UNUSED Paul Eggert
  2014-03-26  1:39   ` _GL_UNUSED Juanma Barranquero
@ 2014-03-26  3:57   ` Eli Zaretskii
  2014-03-26  9:29     ` _GL_UNUSED Juanma Barranquero
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2014-03-26  3:57 UTC (permalink / raw)
  To: Paul Eggert; +Cc: lekktu, emacs-devel

> Date: Tue, 25 Mar 2014 18:22:38 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> 
> Juanma Barranquero wrote:
> > It's OK to use _GL_UNUSED in the sources, or there's some preference
> > not to use it for some reason?
> 
> The typical practice is to configure with --enable-gcc-warnings. 
> Turning on all GCC warnings can cause more trouble than it cures. 

At least on Windows, it does: you get gobs of useless warnings about
mismatch between signed and unsigned char pointers being passed to
some C library functions.  That warning gets my vote for being the
most useless compiler warning ever invented.



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

* Re: _GL_UNUSED
  2014-03-26  3:57   ` _GL_UNUSED Eli Zaretskii
@ 2014-03-26  9:29     ` Juanma Barranquero
  2014-03-26 15:21       ` _GL_UNUSED Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Juanma Barranquero @ 2014-03-26  9:29 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Paul Eggert, Emacs developers

On Wed, Mar 26, 2014 at 4:57 AM, Eli Zaretskii <eliz@gnu.org> wrote:

> At least on Windows, it does: you get gobs of useless warnings about
> mismatch between signed and unsigned char pointers being passed to
> some C library functions.  That warning gets my vote for being the
> most useless compiler warning ever invented.

That's one of the few that I have disabled :-)

What about the "discards 'const' qualifier from pointer target type"?
I get >350 of these in a typical bootstrap... Another "good" one.



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

* Re: _GL_UNUSED
  2014-03-26  9:29     ` _GL_UNUSED Juanma Barranquero
@ 2014-03-26 15:21       ` Eli Zaretskii
  2014-03-26 15:24         ` _GL_UNUSED Juanma Barranquero
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2014-03-26 15:21 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: eggert, emacs-devel

> From: Juanma Barranquero <lekktu@gmail.com>
> Date: Wed, 26 Mar 2014 10:29:50 +0100
> Cc: Paul Eggert <eggert@cs.ucla.edu>, Emacs developers <emacs-devel@gnu.org>
> 
> What about the "discards 'const' qualifier from pointer target type"?

That one's actually useful in catching mistakes, so if you can fix
some of them, it would be good, I think.



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

* Re: _GL_UNUSED
  2014-03-26 15:21       ` _GL_UNUSED Eli Zaretskii
@ 2014-03-26 15:24         ` Juanma Barranquero
  0 siblings, 0 replies; 7+ messages in thread
From: Juanma Barranquero @ 2014-03-26 15:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Paul Eggert, Emacs developers

On Wed, Mar 26, 2014 at 4:21 PM, Eli Zaretskii <eliz@gnu.org> wrote:

> That one's actually useful in catching mistakes, so if you can fix
> some of them, it would be good, I think.

The problem being, even a cursory check of 350 of them is a bit too
much. Something for a long, rainy weekend.

    J



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

end of thread, other threads:[~2014-03-26 15:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-26  1:02 _GL_UNUSED Juanma Barranquero
2014-03-26  1:22 ` _GL_UNUSED Paul Eggert
2014-03-26  1:39   ` _GL_UNUSED Juanma Barranquero
2014-03-26  3:57   ` _GL_UNUSED Eli Zaretskii
2014-03-26  9:29     ` _GL_UNUSED Juanma Barranquero
2014-03-26 15:21       ` _GL_UNUSED Eli Zaretskii
2014-03-26 15:24         ` _GL_UNUSED Juanma Barranquero

Code repositories for project(s) associated with this external index

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

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.