RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: rpm/build/ files.c

From: Ralf S. Engelschall <rse+rpm-devel@rpm5.org>
Date: Tue 06 Nov 2007 - 13:44:08 CET
Message-ID: <20071106124408.GA14845@engelschall.com>
On Tue, Nov 06, 2007, Jeff Johnson wrote:

> This assumes typeof(flp->fl_mode) == typeof(matchpathcon arg).

Yes, I was under the impression that the argument to matchpathcon is a
"mode_t" (according to at least http://linux.die.net/man/3/matchpathcon)
and "fl_mode" is an alias for "struct stat"'s "st_mode" which in
turn is defined (at least by POSIX) to be also of type "mode_t"
(http://www.opengroup.org/onlinepubs/000095399/basedefs/sys/stat.h.html).

So, this change should be just fine. At least the change should make no
difference because in ISO-C AFAIK...

  foo_t foo = bar;
  foo_xxx(foo);

causes the value of "bar" coerced into "foo_t" exactly the same way as in:

  foo_xxx(bar);

At least as long as the proper prototype

  extern [...] foo_xxx(foo_t arg);

is present, of course. If "bar" is not already of type "foo_t" or a
fully compatible type which can be implicitly coerced, we would get a
warning in both situations, of course.

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com
Received on Tue Nov 6 13:52:11 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.