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

Bug#592019: gcc-4.4-base: guint64 causes printf functions to output incorrect information



Package: gcc-4.4-base
Version: 4.4.4-7
Severity: critical
Tags: squeeze
Justification: causes serious data loss

When using one of the printf functions, guint64 variables cause the following
value to be incorrectly displyed.

The following code illustrates this:
#include <stdio.h>
#include <glib.h>

int main( argv, argc ) {
        guint8 g1, g2;
        guint64 g3, g4;
        char *TS;
        TS = "This is a test";


        g1 = 1;
        g2 = 2;
        g3 = 3;
        g4 = 4;
        printf("g1 %u, g2 %u, g3 %u, g4 %u\n", g1, g2, g3, g4);
        printf("g1 %u, g3 %u, g2 %u, g4 %u\n", g1, g3, g2, g4);
        printf("g3 %u, TS %s\n", g3, TS);
        printf("g1 %u\n", g1);
        printf("g2 %u\n", g2);
        printf("g3 %u\n", g3);
        printf("g4 %u\n", g4);
        printf("TS %s\n", TS);
        return;
}

generates:
g1 1, g2 2, g3 3, g4 0
g1 1, g3 3, g2 0, g4 2
g3 3, TS (null)
g1 1
g2 2
g3 3
g4 4
TS This is a test

Note that output line 1, g4 outputs as 0, line2 g2 outputs as 0, and line 3
shows the string as NULL.



-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (600, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

-- no debconf information



Reply to: