Bug 191867

Summary: Wno-unused-function used by mistake?
Product: Base System Reporter: steven
Component: kernAssignee: Dimitry Andric <dim>
Status: Closed FIXED    
Severity: Affects Only Me CC: dim
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
URL: http://svnweb.freebsd.org/base/head/sys/conf/kern.mk?view=annotate#l32

Description steven 2014-07-14 18:44:41 UTC
Hi,

r261991 by dim@ added -Wno-unused-function to kernel compile flags via CWARNEXTRA.  Also MFCd to 10-STABLE by r263763 and 9-STABLE by r263509

This looks wrong in context and from the preceding comment.  I think the intent may have been to only *not fail* in case of the warning (-Wno-error-unused-function).  But instead, this type of was disabled completely from being shown.

I thought this ought to be double-checked (or otherwise fix the comment if it is intentional).  Just in case one day, an unused function is introduced and nobody ever sees the warning...

Thanks!!
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2014-07-14 19:23:52 UTC
The reason I added -Wno-unused-function is that I got sick of fixing unused function warnings all over the code so I could import a new version of clang. :)

In any case, you are probably right that it is better to at least enable the warning message, in the (IMO rather vain) hope that somebody will eventually fix those warnings, either by marking the functions __unused, or by simply deleting them.
Comment 2 commit-hook freebsd_committer freebsd_triage 2014-07-16 20:37:34 UTC
A commit references this bug:

Author: dim
Date: Wed Jul 16 20:37:04 UTC 2014
New revision: 268774
URL: http://svnweb.freebsd.org/changeset/base/268774

Log:
  After r261991, clang warnings about unused functions in the kernel were
  completely silenced.  Make sure these warnings appear again, so there is
  some incentive to fix them, but do not error out the whole kernel build
  for them.

  Noticed by:	steven@pyro.eu.org
  PR:		191867
  MFC after:	3 days

Changes:
  head/sys/conf/kern.mk
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2014-07-16 20:38:46 UTC
Fix committed in r268774, now waiting for the MFC timeout (3 days).
Comment 4 steven 2014-07-16 21:00:30 UTC
Thanks for this!  Here's to hoping some people will see the warnings, and clean up from time to time.
Comment 5 commit-hook freebsd_committer freebsd_triage 2014-07-19 18:33:46 UTC
A commit references this bug:

Author: dim
Date: Sat Jul 19 18:33:09 UTC 2014
New revision: 268882
URL: http://svnweb.freebsd.org/changeset/base/268882

Log:
  MFC r268774:

  After r261991, clang warnings about unused functions in the kernel were
  completely silenced.  Make sure these warnings appear again, so there is
  some incentive to fix them, but do not error out the whole kernel build
  for them.

  Noticed by:	steven@pyro.eu.org
  PR:		191867

Changes:
_U  stable/10/
  stable/10/sys/conf/kern.mk
_U  stable/9/sys/
  stable/9/sys/conf/kern.mk
Comment 6 Dimitry Andric freebsd_committer freebsd_triage 2014-07-19 18:35:28 UTC
Fix merged to stable/10 and stable/9 in r268882.