🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2531

Is this a bug in Quick C?

#2531
From: house ron
Date: Mon, 11 Mar 1991 09:34
25 lines
1221 bytes
A friend has found that the following program behaves oddly under
Quick C:


main()
{
    int i,j;char c;
    i = scanf("%d%c",&j,&c);
    printf("%d %d %c\n",i,j,c);
}

The idea is to have the newline typed after the number put into c.
However, Quick C version 2.5 requires that the user type TWO newlines
before any output is produced.  Earlier versions, and other C compilers
I have tried (Power C, TopSpeed C) produce their output after the
expected one newline.  I know the behaviour of Quick C V2.5 is wierd,
but is it actually ILLEGAL, according to the ANSI C standard?  It is
a question of timing, and most language standards are very lax about
that issue.

--
Regards,

Ron House.   (s64421@zeus.usq.edu.au)
(By post: Info Tech, U.C.S.Q. Toowoomba. Australia. 4350)
Technical Details
Message-ID: <s64421.668684042@zeus>
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!hsdndev!wuarchive!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!brolga!bunyip.cc.uq.oz.au!zeus!s64421

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!hsdndev!wuarchive!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!brolga!bunyip.cc.uq.oz.au!zeus!s64421
From: s64421@zeus.usq.EDU.AU (house ron)
Newsgroups: comp.std.c,comp.os.msdos.programmer
Subject: Is this a bug in Quick C?
Message-ID: <s64421.668684042@zeus>
Date: 11 Mar 91 09:34:02 GMT
Lines: 25