🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Micha Meier Thu, 06 Aug 1992 18:17
Bug in postincrement
#292
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads