c/2904: printf changes order
guedem@uni-freiburg.de
guedem@uni-freiburg.de
Tue May 22 13:56:00 GMT 2001
>Number: 2904
>Category: c
>Synopsis: printf changes order
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue May 22 13:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: guedem@uni-freiburg.de
>Release: unknown-1.0
>Organization:
>Environment:
gcc version 2.95.2 19991024 (release)
i486-suse-linux
>Description:
don't know whether this is realy a bug, but printf (and fprint and fvprintf)
seems to change the order of the ouput. The following little
programm produces the out put "3, 2, 1". But I've expected to
receive "1, 2, 3".
>How-To-Repeat:
#include <stdio.h>
int main()
{
int a[] = {1, 2, 3};
int* iPtr = a;
printf("%d, %d, %d\n", *iPtr++, *iPtr++, *iPtr++);
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list