From owner-freebsd-current Sat Oct 12 01:22:34 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id BAA09756 for current-outgoing; Sat, 12 Oct 1996 01:22:34 -0700 (PDT) Received: from critter.tfs.com ([140.145.230.177]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id BAA09744; Sat, 12 Oct 1996 01:22:28 -0700 (PDT) Received: from critter.tfs.com (localhost.tfs.com [127.0.0.1]) by critter.tfs.com (8.7.5/8.7.3) with ESMTP id KAA03205; Sat, 12 Oct 1996 10:21:37 +0200 (MET DST) To: "Philippe Charnier" cc: current@FreeBSD.org Subject: Re: gcc's bug. please comment In-reply-to: Your message of "Fri, 11 Oct 1996 21:05:36 +0200." <199610111905.VAA01615@xp11.frmug.org> Date: Sat, 12 Oct 1996 10:21:36 +0200 Message-ID: <3203.845108496@critter.tfs.com> From: Poul-Henning Kamp Sender: owner-current@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk In message <199610111905.VAA01615@xp11.frmug.org>, "Philippe Charnier" writes: >Hello, > >A friend found a bug in gcc-2.7.2.1. The following program fails on >i386 architecture (both FreeBSD and solaris-x86) and works as expected >on sparc (both sunos and solaris2.5.1) and on hp (hp-ux9.07). As I'm >not on the gcc-bug list, please comment before I report the bug. This >afternoon I sent a bug report to Sun but it was before trying on >FreeBSD. > >The output should be `1 2' but it is `2 1' on i386 computers. >Here is the code: > >----------mypb2.c----------------- >#include >#include > >main() >{ FILE *fic; > int a[2][50], i = 0; > > fic=fopen("mypb2.csv","r"); > fscanf(fic, "%d;%d", &a[1][i++], &a[1][i++]); The order in which the i++'s get evaluated is not defined by the apocryphical writings, thus the behavior of this line is likely to depend on the parameter passing convention of the CPU. -- Poul-Henning Kamp | phk@FreeBSD.ORG FreeBSD Core-team. http://www.freebsd.org/~phk | phk@login.dknet.dk Private mailbox. whois: [PHK] | phk@ref.tfs.com TRW Financial Systems, Inc. Future will arrive by its own means, progress not so.