🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #292

Bug in postincrement

#292
From: Micha Meier
Date: Thu, 06 Aug 1992 18:17
38 lines
1284 bytes
The following program does *++p instead of *pp++ in gcc version 2.1:

main()
{
        int             a[2];
        register int    *pp = a;

        a[0] = 0;
        a[1] = 20;

        while (pp < a + 2) {
            switch (*pp++) {
            case 0:
                    printf("%d\n", 0);
                    break;
            case 11:
                    printf("%d", 11);
                    break;
            case 12:
                    printf("%d", 12);
                    break;
            case 13:
                    printf("%d", 13);
                    break;
            case 20:
                    printf("%d\n", 20);
                    break;
            default:
                    printf("o");
            }
        }
}

--Micha

Micha Meier				Tel. +49-89-92699-108
ECRC, Arabellastr. 17			Fax  +49-89-92699-170
D-8000 Munich 81			micha@ecrc.de
Technical Details
Message-ID: <9208061417.AA10770@scorpio.ecrc.de>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!ecrc.de!Micha.Meier

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!ecrc.de!Micha.Meier
From: Micha.Meier@ecrc.de (Micha Meier)
Subject: Bug in postincrement
Message-ID: <9208061417.AA10770@scorpio.ecrc.de>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 6 Aug 1992 18:17:25 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 39