> I'm not sure that it's valid C99 - my impression is that it isn't, and
> the only valid way would be to have a function return the DIRENT_TYPE
> by value - but it's valid GNU C and it fixes the bug I was chasing.
I'm not sure either. I don't have a copy of C99 to consult, and my
weasel-wording
> I'm not sure that it's valid C99 - my impression is that it isn't, and
> the only valid way would be to have a function return the DIRENT_TYPE
> by value - but it's valid GNU C and it fixes the bug I was chasing.
I'm not sure either. I don't have a copy of C99 to consult, and my
weasel-wording
On Sun, Nov 03, 2002 at 12:12:25PM -0500, Daniel Jacobowitz wrote:
> On Sat, Nov 02, 2002 at 07:48:24PM -0800, Roland McGrath wrote:
> > I've put in a fix similar to yours but with cosmetic differences.
> > I believe it is valid C99.
>
> Thanks, that's much cleaner than my solution. It looks safe
On Sun, Nov 03, 2002 at 12:12:25PM -0500, Daniel Jacobowitz wrote:
> On Sat, Nov 02, 2002 at 07:48:24PM -0800, Roland McGrath wrote:
> > I've put in a fix similar to yours but with cosmetic differences.
> > I believe it is valid C99.
>
> Thanks, that's much cleaner than my solution. It looks safe
On Sat, Nov 02, 2002 at 07:48:24PM -0800, Roland McGrath wrote:
> I've put in a fix similar to yours but with cosmetic differences.
> I believe it is valid C99.
Thanks, that's much cleaner than my solution. It looks safe to me;
I'll give it a try.
--
Daniel Jacobowitz
MontaVista Software
On Sat, Nov 02, 2002 at 07:48:24PM -0800, Roland McGrath wrote:
> I've put in a fix similar to yours but with cosmetic differences.
> I believe it is valid C99.
Thanks, that's much cleaner than my solution. It looks safe to me;
I'll give it a try.
--
Daniel Jacobowitz
MontaVista Software
I've put in a fix similar to yours but with cosmetic differences.
I believe it is valid C99.
I've put in a fix similar to yours but with cosmetic differences.
I believe it is valid C99.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
On Wed, Oct 30, 2002 at 12:03:12PM +0100, Jakub Jelinek wrote:
> On Wed, Oct 30, 2002 at 10:52:30AM +0100, Wolfram Gloger wrote:
> > > > [That is: two pointers to a buffer, of different types; walk through
> > > > the buffer, reading one object of the first type and writing out an
> > > > object of
On Wed, Oct 30, 2002 at 12:03:12PM +0100, Jakub Jelinek wrote:
> On Wed, Oct 30, 2002 at 10:52:30AM +0100, Wolfram Gloger wrote:
> > > > [That is: two pointers to a buffer, of different types; walk through
> > > > the buffer, reading one object of the first type and writing out an
> > > > object of
Hi,
> But that intermediate buffer is in registers (on sane arches), while using
> memcpy would mean at least with current compilers memory.
True, I just consider that not so bad in this particular case.
> glibc requires gcc (even 3.2+) to compile anyway, so IMHO just using the
> union as drow p
On Wed, Oct 30, 2002 at 10:52:30AM +0100, Wolfram Gloger wrote:
> > > [That is: two pointers to a buffer, of different types; walk through
> > > the buffer, reading one object of the first type and writing out an
> > > object of the second lesser-or-equal sized type.]
> >
> > No, there's no standa
> > [That is: two pointers to a buffer, of different types; walk through
> > the buffer, reading one object of the first type and writing out an
> > object of the second lesser-or-equal sized type.]
>
> No, there's no standard C way to do that. An object can only have one
> type at a time. You h
Hi,
> But that intermediate buffer is in registers (on sane arches), while using
> memcpy would mean at least with current compilers memory.
True, I just consider that not so bad in this particular case.
> glibc requires gcc (even 3.2+) to compile anyway, so IMHO just using the
> union as drow p
On Wed, Oct 30, 2002 at 10:52:30AM +0100, Wolfram Gloger wrote:
> > > [That is: two pointers to a buffer, of different types; walk through
> > > the buffer, reading one object of the first type and writing out an
> > > object of the second lesser-or-equal sized type.]
> >
> > No, there's no standa
> > [That is: two pointers to a buffer, of different types; walk through
> > the buffer, reading one object of the first type and writing out an
> > object of the second lesser-or-equal sized type.]
>
> No, there's no standard C way to do that. An object can only have one
> type at a time. You h
Daniel Jacobowitz <[EMAIL PROTECTED]> writes:
> On Tue, Oct 29, 2002 at 11:33:49PM +0100, Andreas Schwab wrote:
> That works, patch attached. With this I can use -O2 on i386 again -
> it's not a pretty patch but it does work at least :) My understanding
> is that this uses a GCC extension which s
On Tue, Oct 29, 2002 at 11:33:49PM +0100, Andreas Schwab wrote:
> Daniel Jacobowitz <[EMAIL PROTECTED]> writes:
>
> |> Highlights:
> |> char *kbuf = buf;
> |> size_t kbytes = nbytes;
> |> if (offsetof (DIRENT_TYPE, d_name)
> |> < offsetof (struct kernel_dirent64, d_name
Daniel Jacobowitz <[EMAIL PROTECTED]> writes:
> On Tue, Oct 29, 2002 at 11:33:49PM +0100, Andreas Schwab wrote:
> That works, patch attached. With this I can use -O2 on i386 again -
> it's not a pretty patch but it does work at least :) My understanding
> is that this uses a GCC extension which s
On Tue, Oct 29, 2002 at 11:33:49PM +0100, Andreas Schwab wrote:
> Daniel Jacobowitz <[EMAIL PROTECTED]> writes:
>
> |> Highlights:
> |> char *kbuf = buf;
> |> size_t kbytes = nbytes;
> |> if (offsetof (DIRENT_TYPE, d_name)
> |> < offsetof (struct kernel_dirent64, d_name
Daniel Jacobowitz <[EMAIL PROTECTED]> writes:
|> Highlights:
|> char *kbuf = buf;
|> size_t kbytes = nbytes;
|> if (offsetof (DIRENT_TYPE, d_name)
|> < offsetof (struct kernel_dirent64, d_name)
|> && nbytes <= sizeof (DIRENT_TYPE))
|> {
|> kb
Highlights:
char *kbuf = buf;
size_t kbytes = nbytes;
if (offsetof (DIRENT_TYPE, d_name)
< offsetof (struct kernel_dirent64, d_name)
&& nbytes <= sizeof (DIRENT_TYPE))
{
kbytes = nbytes + offsetof (struct kernel_dirent64, d_name)
Daniel Jacobowitz <[EMAIL PROTECTED]> writes:
|> Highlights:
|> char *kbuf = buf;
|> size_t kbytes = nbytes;
|> if (offsetof (DIRENT_TYPE, d_name)
|> < offsetof (struct kernel_dirent64, d_name)
|> && nbytes <= sizeof (DIRENT_TYPE))
|> {
|> kb
Highlights:
char *kbuf = buf;
size_t kbytes = nbytes;
if (offsetof (DIRENT_TYPE, d_name)
< offsetof (struct kernel_dirent64, d_name)
&& nbytes <= sizeof (DIRENT_TYPE))
{
kbytes = nbytes + offsetof (struct kernel_dirent64, d_name)
24 matches
Mail list logo