DragonFly BSD
DragonFly commits List (threaded) for 2005-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cvs commit: src/lib/libc/gen disklabel.c src/lib/libcr/gen disklabel.c src/sbin/disklabel disklabel.c src/usr.sbin/diskpart diskpart.c


From: YONETANI Tomokazu <qhwt+dfly@xxxxxxxxxx>
Date: Fri, 18 Mar 2005 00:44:42 +0900

On Thu, Mar 17, 2005 at 03:26:42PM +0100, Joerg Sonnenberger wrote:
> >   Constify all users of dktypenames to unbreak buildworld.
> >   Reported-by: walt
> 
> I'm not sure why world broke through. That's strange.

I should've been more explicit about what I claimed to fix. gcc fails
miserably if one tries to get a difference of two addresses whose target
types are different and there's no implicit conversions available, so:

  const char **ccpp;
  char **cpp;
  int idx;

  idx = cpp - ccpp;	/* NG */
  idx = *cpp - *ccpp;	/* OK, *cpp converted to (const char *) */
  idx = *ccpp - *cpp;	/* NG, (const char *) to (char *) */

but what I don't understand is that this produces only a warning:

  idx = cpp < ccpp;



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]