[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tar-bug
Subject:    RE: [Bug-tar] x86/Solaris test failure (25, 28)
From:       "Matthew Woehlke" <mwoehlke () tibco ! com>
Date:       2007-03-08 20:09:13
Message-ID: E4B46A50CCA52348A67B3506C79BB3902CA9E9 () NA-PA-VBE01 ! na ! tibco ! com
[Download RAW message or body]

Joerg Schilling wrote:
> Matthew Woehlke wrote:
> > First, a build failure: I had to change src/xheader.c:1097:
> >
> > -  const struct timespec mtime = data ? *(struct timespec *) data :
st->mtime;
> > +  const struct timespec mtime = data ? *(const struct timespec *)
data : st->mtime;
> >
> > (seems like a pedantic compiler thing, but...)
> 
> Not a pedantic compiler buit a compiler that honors "const".
> Unfortunately, GCC mostly ignores const.

If this was assigning a pointer, that would make sense, but that isn't
what is happening. This is assigning the value of a non-const struct to
a const struct, which should be a copy operation, shouldn't it?

Oddly enough, this succeeds:

====
struct bar {
    int x,y;
};

int main() {
    struct bar a = { 2, 5 };
    const struct bar b = a.y ? *(struct bar*)(&a) : a;
    return b.y;
}
====

...so I don't actually know why this failed in the first place.

Anyway, it isn't important. :-)

-- 
Matthew



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic