Re: CVS commit: src/sys/fs/puffs

2014-10-06 Thread Robert Elz
Date:Mon, 6 Oct 2014 14:26:44 +
From:Havard Eidnes h...@netbsd.org
Message-ID:  20141006142644.7693...@cvs.netbsd.org

  | Make this build again without debugging enabled; DPRINTF() can end up
  | as empty, and in an if conditional, you then need braces if that's the
  | only potential body.

That change makes no sense to me - the original code was

if (error)
DPRINTF(());

and even if DPRINTF() could produce nothing, the result would be

if (error)
;

which is perfectly good C (useless, but acceptable).  Adding { } around
the ';' changes nothing.

But in any case, apb changed it yesterday, so DPRINTF() never produces
nothing (personally I'm not sure that should have been needed, but that's
beside the point).

What was the error that resulted in the addition of the {} ?

lre



Re: CVS commit: src/sys/fs/puffs

2014-10-06 Thread Havard Eidnes
   | Make this build again without debugging enabled; DPRINTF() can end up
   | as empty, and in an if conditional, you then need braces if that's the
   | only potential body.

 That change makes no sense to me - the original code was

   if (error)
   DPRINTF(());

 and even if DPRINTF() could produce nothing, the result would be

   if (error)
   ;

 which is perfectly good C (useless, but acceptable).  Adding { } around
 the ';' changes nothing.

Well...

compile  puffs/puffs_vnops.o
/u/build/HEAD/src/sys/fs/puffs/puffs_vnops.c: In function 'zerofill_lastpage':
/u/build/HEAD/src/sys/fs/puffs/puffs_vnops.c:1160:70: error: suggest braces 
around empty body in an 'if' statement [-Werror=empty-body]
   DPRINTF((zero-fill 0x%lx@0x% PRIx64  = %d\n, len, off, error));
  ^
cc1: all warnings being treated as errors

*** Failed target:  puffs_vnops.o

 But in any case, apb changed it yesterday, so DPRINTF() never produces
 nothing (personally I'm not sure that should have been needed, but that's
 beside the point).

Ah.  It's quite possible that my latest update was from before
that commit.

 What was the error that resulted in the addition of the {} ?

See above.

Regards,

- HÃ¥vard