branches/KDE/3.4/kdepim/libkcal - Debian

This is a discussion on branches/KDE/3.4/kdepim/libkcal - Debian ; SVN commit 451025 by kainhofe: ARRRGGH! Just when we release kde 3.4.2, a nasty bug in connection with gcc 4.0 (NOT with 3.3.x, which I use) creeps up: It seems that gcc 4.0 is no longer initializing all members of ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: branches/KDE/3.4/kdepim/libkcal

  1. branches/KDE/3.4/kdepim/libkcal

    SVN commit 451025 by kainhofe:

    ARRRGGH! Just when we release kde 3.4.2, a nasty bug in connection with gcc 4.0 (NOT with 3.3.x, which I use) creeps up:
    It seems that gcc 4.0 is no longer initializing all members of a struct, while gcc 3.3.x obviously did something like that. So we can't simply take a new icaltime structure, since its member will be initialized with random values in gcc 4.0. So everything that later on checks the members of the struct will work on uninitialized values! Rather, we need to use a null time (all fields initialized to 0) and set all necessary fields later on.
    This fixes the end date corruption (only of all-day events) that vanRijn and and Will are observing with their gcc 4.0-compiled kdepim.

    If any distribution is using kde 3.4.2 compiled with gcc 4.0, I suppose this fix needs to go in!

    (Backport of commit 451010 from the 3.5 branch)

    CCMAIL: debian-kde@lists.debian.org



    M +2 -2 icalformatimpl.cpp


    --- branches/KDE/3.4/kdepim/libkcal/icalformatimpl.cpp #451024:451025
    @@ -2107,7 +2107,7 @@

    icaltimetype ICalFormatImpl::writeICalDate(const QDate &date)
    {
    - icaltimetype t;
    + icaltimetype t = icaltime_null_time();

    t.year = date.year();
    t.month = date.month();
    @@ -2128,7 +2128,7 @@

    icaltimetype ICalFormatImpl::writeICalDateTime(const QDateTime &datetime)
    {
    - icaltimetype t;
    + icaltimetype t = icaltime_null_time();

    t.year = datetime.date().year();
    t.month = datetime.date().month();


    --
    To UNSUBSCRIBE, email to debian-kde-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  2. Re: branches/KDE/3.4/kdepim/libkcal

    Le Ven 19 Août 2005 20:40, Reinhold Kainhofer a écrit :
    > It seems that gcc 4.0 is no longer initializing all members of a
    > struct, while gcc 3.3.x obviously did something like that.


    Then it's a gcc bug.

    when you write :

    Type1 func(...) {
    Type foo;
    }

    AFAIK either Type is a class, and then it's () constructor is called,
    else if it's a struct, a default constructor is called, that does the
    same as in C : it allocates enough space to make the struct live in it,
    and then sets all its bits to 0.

    If you have evidences that it's not done, I suggest you to bug gcc since
    a really serious problem.

    --
    ·O· Pierre Habouzit
    ··O madcoder@debian.org
    OOO http://www.madism.org

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.1 (GNU/Linux)

    iD8DBQBDBi+gvGr7W6HudhwRAqAgAKCgrlHZlDhRARIylQdbUj pOOvZtkQCfUp40
    X5LHJ9CmtY1LpMDvVt4vqhU=
    =oDXe
    -----END PGP SIGNATURE-----


  3. Re: branches/KDE/3.4/kdepim/libkcal

    * Reinhold Kainhofer [Fri, 19 Aug 2005 18:40:03 +0000]:

    > SVN commit 451025 by kainhofe:


    > ARRRGGH! Just when we release kde 3.4.2, a nasty bug in connection with gcc 4.0 (NOT with 3.3.x, which I use) creeps up:
    > It seems that gcc 4.0 is no longer initializing all members of a struct, while gcc 3.3.x obviously did something like that. So we can't simply take a new icaltime structure, since its member will be initialized with random values in gcc 4.0. So everything that later on checks the members of the struct will work on uninitialized values! Rather, we need to use a null time (all fields initialized to 0) and set all necessary fields later on.
    > This fixes the end date corruption (only of all-day events) that vanRijn and and Will are observing with their gcc 4.0-compiled kdepim.


    > If any distribution is using kde 3.4.2 compiled with gcc 4.0, I suppose this fix needs to go in!


    Thanks for this notice, Reinhold! I'm notifying our kdepim maintainer,
    but perhaps you'd wish to mail kde-packager@kde.org too? That way,
    other distributions will be aware too.

    > (Backport of commit 451010 from the 3.5 branch)


    > CCMAIL: debian-kde@lists.debian.org




    > M +2 -2 icalformatimpl.cpp



    > --- branches/KDE/3.4/kdepim/libkcal/icalformatimpl.cpp #451024:451025
    > @@ -2107,7 +2107,7 @@


    > icaltimetype ICalFormatImpl::writeICalDate(const QDate &date)
    > {
    > - icaltimetype t;
    > + icaltimetype t = icaltime_null_time();


    > t.year = date.year();
    > t.month = date.month();
    > @@ -2128,7 +2128,7 @@


    > icaltimetype ICalFormatImpl::writeICalDateTime(const QDateTime &datetime)
    > {
    > - icaltimetype t;
    > + icaltimetype t = icaltime_null_time();


    > t.year = datetime.date().year();
    > t.month = datetime.date().month();




    --
    Adeodato Sim
    EM: asp16 [ykwim] alu.ua.es | PK: DA6AE621

    The difference between literature and journalism is that journalism is
    unreadable and literature is not read.
    -- Oscar Wilde


    --
    To UNSUBSCRIBE, email to debian-kde-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  4. Re: branches/KDE/3.4/kdepim/libkcal

    On Friday 19 August 2005 21:14, Pierre Habouzit wrote:
    > Le Ven 19 Aot 2005 20:40, Reinhold Kainhofer a crit :
    > > It seems that gcc 4.0 is no longer initializing all members of a
    > > struct, while gcc 3.3.x obviously did something like that.

    >
    > Then it's a gcc bug.
    >
    > when you write :
    >
    > Type1 func(...) {
    > Type foo;
    > }
    >
    > AFAIK either Type is a class, and then it's () constructor is called,
    > else if it's a struct, a default constructor is called, that does the
    > same as in C : it allocates enough space to make the struct live in
    > it,


    correct

    > and then sets all its bits to 0.


    since when? You've to initialize PODs (bool, int, pointer, ...) yourself
    in C and C++.

  5. Re: branches/KDE/3.4/kdepim/libkcal

    Le Ven 19 Aot 2005 21:50, Andr Wbbeking a crit :
    > On Friday 19 August 2005 21:14, Pierre Habouzit wrote:
    > > Le Ven 19 Aot 2005 20:40, Reinhold Kainhofer a crit :
    > > > It seems that gcc 4.0 is no longer initializing all members of a
    > > > struct, while gcc 3.3.x obviously did something like that.

    > >
    > > Then it's a gcc bug.
    > >
    > > when you write :
    > >
    > > Type1 func(...) {
    > > Type foo;
    > > }
    > >
    > > AFAIK either Type is a class, and then it's () constructor is
    > > called, else if it's a struct, a default constructor is called,
    > > that does the same as in C : it allocates enough space to make the
    > > struct live in it,

    >
    > correct
    >
    > > and then sets all its bits to 0.

    >
    > since when? You've to initialize PODs (bool, int, pointer, ...)
    > yourself in C and C++.


    okay, you're correct, I just checked in my books. I do too many C those
    days, sorry for the noise.

    gcc 4 is *not* wrong, though it should have a warning for that ...
    --
    O Pierre Habouzit
    O madcoder@debian.org
    OOO http://www.madism.org

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.1 (GNU/Linux)

    iD4DBQBDBjk5vGr7W6HudhwRArjLAJ4naeh5Fh/ULa49deDU2XR6BVL5fwCYwMzW
    nweGEpQ2zVonlV0uAptuCA==
    =qMbt
    -----END PGP SIGNATURE-----


+ Reply to Thread