This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c/2904: printf changes order



>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]