Bug 199641 - Growfs does not compile in debugmode (GFSDBG)
Summary: Growfs does not compile in debugmode (GFSDBG)
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.1-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: Edward Tomasz Napierala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-23 11:12 UTC by Willem Jan Withagen
Modified: 2016-11-04 13:55 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Willem Jan Withagen 2015-04-23 11:12:41 UTC
cd /usr/src/sbin/growfs
make -DGFSDBG
Returns errors while building.

Probably because the debug code is normally execluded.

2* int versus u_int_32
2* char-pointer cast to uint-pointer

First is fixed by changing type
Second is fixed by getting the compiler to ignore the warning.
Which IMHO is valid since compiling GFSDBG is only done if you sort of know what is going on.....

Perhaps a suggestion on debugging on the manual page would be approriate as well.

Tested on 10.1, but probably valid on others as well.

svn diff:
Index: sbin/growfs/Makefile
===================================================================
--- sbin/growfs/Makefile        (revision 281869)
+++ sbin/growfs/Makefile        (working copy)
@@ -17,6 +17,8 @@

 .if defined(GFSDBG)
 SRCS+=  debug.c
+CFLAGS+=-DFS_DEBUG
+NO_WCAST_ALIGN= yes
 .endif

 DPADD= ${LIBUTIL}
Index: sbin/growfs/growfs.c
===================================================================
--- sbin/growfs/growfs.c        (revision 281869)
+++ sbin/growfs/growfs.c        (working copy)
@@ -161,7 +161,7 @@
 #ifdef FS_DEBUG
        {
                struct csum *dbg_csp;
-               int dbg_csc;
+               u_int32_t dbg_csc;
                char dbg_line[80];

                dbg_csp = fscs;
@@ -242,7 +242,7 @@
 #ifdef FS_DEBUG
        {
                struct csum     *dbg_csp;
-               int     dbg_csc;
+               u_int32_t       dbg_csc;
                char    dbg_line[80];

                dbg_csp = fscs;
Comment 1 commit-hook freebsd_committer freebsd_triage 2015-04-24 12:49:13 UTC
A commit references this bug:

Author: trasz
Date: Fri Apr 24 12:48:49 UTC 2015
New revision: 281929
URL: https://svnweb.freebsd.org/changeset/base/281929

Log:
  Fix growfs(8) build with debug enabled (make -DGFSDBG).

  PR:		199641
  Submitted by:	Willem Jan Withagen <wjw at digiware dot nl>
  MFC after:	1 month
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/sbin/growfs/Makefile
  head/sbin/growfs/growfs.c
Comment 2 Edward Tomasz Napierala freebsd_committer freebsd_triage 2016-11-04 13:55:42 UTC
MFC-ed to 10 as r284669.