🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1878

gcc 1.28 bug -- short to long

#1878
From: Paul English
Date: Fri, 07 Oct 1988 19:39
18 lines
741 bytes
Is this a bug? (The standard Sun C compiler sets `lo' to 65535.)

/* short2long.c, pme@umb.umb.edu, 07oct88 */
/* Demonstrate gcc 1.28 bug. */

#include <stdio.h>

void main()
{
    unsigned short sh;
    unsigned long lo;

    sh = ~0;		/* all ones, or, 65535 */
    lo = sh;		/* 0, but why? */

    printf( "sh = %d, lo = %d\n", sh, lo );
    /* Output is 65535, 0 */
}
Technical Details
Message-ID: <8810071939.AA24542@ra.cs>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!tut.cis.ohio-state.edu!ra.umb.edu!pme

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!tut.cis.ohio-state.edu!ra.umb.edu!pme
From: pme@ra.umb.edu (Paul English)
Newsgroups: gnu.gcc.bug
Subject: gcc 1.28 bug -- short to long
Message-ID: <8810071939.AA24542@ra.cs>
Date: 7 Oct 88 19:39:25 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 18