HDTenEightyP/NetNews huggingface dataset:
From: carl@montebello.ecom.unimelb.EDU.AU (Carl Brewer)
Subject: Funny problem with a pause routine
Organization: Computer Science, University of Melbourne, Australia
Date: Mon, 16 Nov 1992 12:17:15 GMT

ok, here's a routine I copied from a book, and can see no reason why
it won't work, but first, some background ..

compiler, gcc on SunOS 4.1.2, (ANSI)

the bug

it works the first time I call it, but from then it only works if
I get it to do the getchar() twice ...

otherwise, it just skips over it, and there is no wait for the <cr>



enough preamble

void pause()
{
    char ans;
    fflush(stdin);
    fprintf(stdout, "Press <Return> to continue\n");
    ans = getchar();
    fflush(stdin);

    return;
}

I've tried this with the getchar cast to void [ (void)getchar(); ],
and tried gets(), getc() etc, all to no avail.

any ideas?


-- 
 Annal  Natrach, Usthvah Spethed,         carl@ecr.mu.oz.au (IRC: Bleve)
 Dochoel Dienve                           carl@munagin.ee.mu.oz.au
					  carl@montebello.ecom.unimelb.EDU.AU
 Merlin, where are you?  Call your dragon, to weave a mist...
Xref: sparky comp.lang.c:16668 comp.software-eng:4341
From: kambic@iccgcc.decnet.ab.com (Bonus, Iniquus, Celer - Delegitus Duo)
Newsgroups: comp.lang.c,comp.software-eng
Subject: Re: Will we keep ignoring this productivity issue?
Date: 17 Nov 92 09:12:20 EST

In article <Bxtq6J.Br1@cs.uiuc.edu>, hasker@cs.uiuc.edu (Rob Hasker) writes:
> pdh@netcom.com (Phil Howard ) writes:
[...]
>>In EE you START from the bottom and work your way up.  You learn to
>>understand the building blocks.  Computers SHOULD be taught the same
>>way.  
[...]

> The question is, what is the "bottom" in CS?  Hardware?  I suppose
> that's traditional, but it's not the obviously correct answer since it
> de-emphasizes looking at systems abstractly.  
[...]
> Others would argue the case for the basis of CS being math.  
[...]

There is no one answer.  The schools, and companies, with all of their various
benefits and faults, act as filters to somehow give those people who will be
"superprogrammers" the background knowledge in SW/CS that will enable them to
apply their innate systemic thinking processes to SW and CS.  I don't know if
any particular  type of educational system, curriculum, course work, will
optimum for all SE's.  At this stage of the development of SE, it is probably
better that there is no stable curriculum.  The field is still too dynamic.  

IMHO, there is probably no better background for SE than physics.  Why? 
Problem solving.  Experimental techniques.  Basic understanding of the
strangeness of the universe.  All useful.  

We are all  experiments in software engineering right now, because the field 
doesn't have the stability in training or definition that it needs.   

George Kambic
sd

Newsgroups: comp.lang.c
From: steve@taumet.com (Steve Clamage)
Subject: Re: Idle Questions about ANSI C
Organization: TauMetric Corporation
Date: Sat, 14 Nov 1992 16:26:33 GMT

pjh@mccc.edu (P. J. Holsberg) writes:

>1) Is "size_t" ever not the same as "unsigned int"? If so, in what situation?

If the address space is large but ints are small, size_t will be unsigned
long.  If address space is small but ints are large, you might want to
make size_t an unsigned short.  I've seen implementations like the first
case.  The second case seems unlikely.  Both could be Standard-conforming.


>2) Is there ever a need for a static array defined inside a function in
>ANSI C? I.e.,

>int func(char c, int i)
>{
>	static char name[30];
>	...
>}

This has nothing to with ANSI C.  The question is whether you want the
variable to retain its value across function calls, even recursive ones.

A local static has the same semantics as a file-level static, but its
visibility (scope) is limited.  It is hidden from other functions in the
same module (or possibly from other blocks in the same function).

Use a local static when you want to retain state information across calls
to the function and want to hide the variable from other functions (or
other scopes).  I don't see why an array would be either more or less
likely to fit into this category than any other data type.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
Vice Chair, ANSI C++ Committee, X3J16
Xref: sparky comp.lang.c:16689 comp.software-eng:4354
From: kambic@iccgcc.decnet.ab.com (Bonus, Iniquus, Celer - Delegitus Duo)
Newsgroups: comp.lang.c,comp.software-eng
Subject: Re: Will we keep ignoring this productivity issue?
Date: 17 Nov 92 15:03:29 EST

In article <books.110.0@fsunuc.physics.fsu.edu>, books@fsunuc.physics.fsu.edu (Roger Books) writes:
> In article <1992Nov17.091220.9284@iccgcc.decnet.ab.com> kambic@iccgcc.decnet.ab.com (Bonus, Iniquus, Celer - Delegitus Duo) writes:
>>IMHO, there is probably no better background for SE than physics.  Why? 
>>Problem solving.  Experimental techniques.  Basic understanding of the
>>strangeness of the universe.  All useful.  
> I don't know about that last one.  The Physicists are some of the most
> intelligent people I know.  They can solve almost any problem you throw
> at them, but, their programming is kludgey and atrocious to maintain.
> From what I've seen they seem to be trained to get it done now.  If it
> involves dropping a kludge in to make it work they do and then forget
> about it.  This may be different with theorists but the experimentalists
> I work for don't write maintainable code.

Might be a difference in the objective.  Based on my experience with people 
working on a product as opposed to scientific lab code, code produced by
physicists has not been kludge code (="klode"?).  My experience has been the
commercial environment.

George Kambic
sd

Newsgroups: comp.lang.c,gnu.gcc.help
From: jutta@opal.cs.tu-berlin.de (Jutta Degener)
Subject: Re: Include file directory search path
Organization: Techn. University of Berlin, Germany
Date: Thu, 19 Nov 1992 01:28:18 GMT

sim@mdtf14.fnal.gov (Jim Sim) writes:

> Is there a way to force the C preprocessor to use the same search path to
> locate nested include files (files included by another include file) 
> that it uses to locate non-nested include files?

Yes.  Do not include from your header files with double quotes,
but with angle brackets instead; and insert -I. in front of the
cc command line options.

Jutta (jutta@cs.tu-berlin.de)
From: upbikkas@uncc.edu (Udayabhanu P Bikkasani)
Newsgroups: comp.lang.c
Subject: making bin file of the source code
Date: 23 Nov 92 01:40:56 GMT
Reply-To: upbikkas@uncc.edu
Organization: University of NC at Charlotte

can some out there help me make the bin file out of the source code of sohigs available at iamsun.unibe.ch

i am using sun/sparc os 4.1
Keywords: 


---
       ----------------------------------------------------------------------
            UdayaBhanu Bikkasani               upbikkas@unccsun.uncc.edu
            9520, #f, shannon green            
            charlotte  NC-28213                ck128@freenet.cwru.edu 
                              
                            phone: 704-549-4260
       ----------------------------------------------------------------------
Newsgroups: comp.lang.c
From: greyham@research.canon.oz.au (Graham Stoney)
Subject: Re: const char *p == char const *p ?
Organization: Canon Information Systems Research Australia
Date: Fri, 20 Nov 1992 00:43:01 GMT

jos@and.nl (Jos Horsmeier) writes:
>In article <1992Nov16.010820.26757@cs.tu-berlin.de> jutta@opal.cs.tu-berlin.de (Jutta Degener) writes:
>|bonak@herky.cs.uiowa.edu (Esmail Bonakdarian) writes:
>|> Is "char const *p" equivalent to "const char *p"?
>|
>|Yes.  They are both pointers to constant character; you may
>|change the pointer, but not the character it points to.
>|
>|Some programmers prefer "char const *" to "const char *".
>|They argue that C declarations are read "inside out":
>|
>|   char const * p ;
>|                ^     p is a
>|              ^              pointer to
>|        ^^^^^                           constant
>|   ^^^^                                          char
>|
>|But that's just a matter of style.

>Sorry, you're making a mistake, `const char * p' is _not_ equivalent
>to `char * const p'. The first declaration reads: `there is a character
>constant, and p points to it', while the second one reads: `this is 
>a character pointer p and it is a constant.' 

While Jos it correct in what he says about `char * const p', Jutta is not
making a mistake, since they're talking `const char * p'.

regs,
Graham
Newsgroups: comp.lang.c
From: ted@ocsmd.ocs.com (Ted Scott)
Subject: Allocating string space via constant (was Re: Where are literals)
Organization: Online Computer Systems, Inc.  Germantown, Md., 20874
X-Newsreader: Tin 1.1 PL5
Date: Mon, 23 Nov 1992 21:09:47 GMT

Chris Torek (torek@horse.ee.lbl.gov) wrote:
: In article <By0vzy.4Ly@ocsmd.ocs.com> I wrote:
: >Ok, *I'm* confused here. Does this mean that if I do something like:
: > *p[1] = ' '; 
: >q will now point to "A C" ??
: Since p[1] is a value of type `char', *p[1] is illegal: the operand of
: a unary `*' indirection operator must have type `pointer to T', for some
: valid type T.
Um, Er, Ah...
: 
: Assuming you meant
: 	p[1] = ' ';
Thanks for DWIM!


The reasons for my question was that I have run accross *alot* of code
that allocates buffers as:
 
char *foo ="This string constant looks big enough to hold the *REAL* data";

and then goes on to muck with the contents of foo! I hadn't realized 
the inherent dangers of this practice, and apparently neither did 
Mitchell Waite and Steven Prata when they wrote their primer. (p416)
(Yes I know what primers are *for*) They say only that the storage 
obtained with this mechanism is static, nothing aobut it may be part
of a read-only segment.

Probably other C authors haven't explored these corners as well.

: >or will the above assignment yield a SEGV? or what? (I know probably what :)
: Yes, `or what' :-) .  In ANSI C, the effect is explicitly undefined;
: *anything* can happen.  Your computer might suddenly quote King Lear
: (`old Tom's a-cold!'). 
I can only hope ;)

: <Really good explanation of why this is a bad thing deleted>

This really seems to me to be a design error in the language, or the Standard.
Can someone in the know explain how this came about? I mean that if I declare
two seperate pointers to an initialization string that coincedentally are 
identical I may or may not end up aliasing one of them, depending on the
mood of the compiler writer, or maybe even the linker developer. 

Further, it is quite possible that two occurrences of the same program
that share code space under a multitasking OS could point to the same memory
because they share the same string initializer! What a Feature!

IOCC here I come ... <to the tune of Calif. here I come>

--

-Ted Scott          
tscott@ocsmd.ocs.com           I was told that I'm a P.C. person:
(301) 601-2252                               Politically Challenged, that is.
Newsgroups: comp.lang.c
From: champion@cch.coventry.ac.uk (Alun)
Subject: Re: const char *p == char const *p ?
Organization: Coventry University, Coventry, UK.
Date: Tue, 17 Nov 1992 11:05:54 GMT

In article <3870@dozo.and.nl> jos@and.nl (Jos Horsmeier) writes:
~In article <1992Nov16.010820.26757@cs.tu-berlin.de> jutta@opal.cs.tu-berlin.de (Jutta Degener) writes:
~|bonak@herky.cs.uiowa.edu (Esmail Bonakdarian) writes:
~|> Is "char const *p" equivalent to "const char *p"?
~|
~|Yes.  They are both pointers to constant character; you may
~|change the pointer, but not the character it points to.
[stuff deleted]
~
~Sorry, you're making a mistake, `const char * p' is _not_ equivalent
~to `char * const p'. The first declaration reads: `there is a character
~constant, and p points to it', while the second one reads: `this is 
~a character pointer p and it is a constant.' 
~
~Jos aka jos@and.nl

RTFQ.

The question was
Is "char const *p" equivalent to "const char *p"?

Regards

    -Alun
    
-- 
A.Champion                |  That's an interesting point, in the sense of
(champion@uk.ac.cov.cck)  |    being very not interesting at all. - The Liar
  *I'm as bad as the worst - but thank God(?) I am as good as the best !!*
                *I'm not modest - I'm just honest*
Newsgroups: comp.lang.c,comp.lang.c++,alt.tasteless.jokes,rec.humor
From: kurgan@spock.uucp (Andrew Twyman)
Subject: Re: *** IMPORTANT DISCOVERY ***
Organization: Choate Rosemary Hall
Date: Mon, 16 Nov 1992 22:11:56 GMT

In article <1992Nov13.210911.3086@msuinfo.cl.msu.edu> knaggs@cps.msu.edu (Scott A Knaggs) writes:
>"Will you do anything for me?", I asked. "Yes", was your answer. I asked you
>to lay down. You did. I squated right above your head and again, your tongue
>started to do it's job. You heard me make a strange noise: "NNNNNNGGGGG".
>You thought it was my extasy, but you soon found out it was something else.
>You felt something drop on your nose, something which slid slowly into your
>mouth. Your curious tongue tried to find out what it was. Congratulations,
>you just tasted a piece of shit! You really liked it. It turned you on even
>more and I started to grap some off your head and massaged your dick
>with it. Your dick looked great, nice and brown with little lightbrown thick
>pieces on it.  I started to give you a blow job. I really enjoyed the taste
>of cock combined with shit. Especially after you came... I turned around with
>my mouth full and kissed you. I emptied my mouth in yours. You passionately
>returned my kisses. After that we layed in each others arms for minutes.
>You had a big smile on your face.

Not only is this too sick to be on rec.humor (which isn't necessarily bad),
but it's nauseating and DUMB!  Keep it out of my face.  You're even more of a
pervert than I am, and that's a sick thought.
-- 
-------------------------------------------------------------------------------
|  -"I have something to say.  It's better to burn out, than to fade away!"-  |
|                          -* THERE CAN BE ONLY ONE *-                        |
kurgan@choate.edu--------------------------------------------------------------
Newsgroups: comp.lang.c
Subject: Re:  Rounding floats to integers
From: alien@acheron.amigans.gen.nz (Ross Smith)
Date: 16 Nov 92 08:28:42 GMT+12
Distribution: world
Organization: Wanganui Amigans, Wanganui, NZ

In article <1e3brhINN3eb@uwm.edu> eli@csd4.csd.uwm.edu (Elihu Lubkin) writes:
>alien@acheron.amigans.gen.nz (Ross Smith) writes:
>:
>: In programs that have to do this sort of calculation, I usually stick in
>: a macro like this :
>:
>:    #define round(x) ((int)floor((x)+0.5))
>:
>: This handles negative numbers correctly, e.g.
>:
>:    i = round(5.0/0.4);   /* yields 13 (correct)       */
>:    i = round(-5.0/0.4);  /* yields -12 (also correct) */
>:
>: (5/0.4 = 12.5, and the standard convention is that halves are rounded up,
>: so 12.5 gives 13, -12.5 gives -12.)
>:
>     and round(-12.99999...)  /* yields -12 (correct?)  */
>               interesting convention.
>                                --Thelma Lubkin

No, it yields -13. Work it out...

round (-12.99999) -> ((int)floor((-12.99999)+0.5))
                  -> ((int)floor(-12.49999))
                  -> ((int)-13.0)
                  -> -13

The floor() function is required by the standard to yield the greatest integer
less than or equal to its argument.

floor(12.34) -> 12.0
floor(-12.34) -> -13.0

--
...... Ross Smith (Wanganui, NZ) ...... alien@acheron.amigans.gen.nz ......
   "Let us leave this festering hellhole.  Let us think the unthinkable,
let us do the undoable.  Let us prepare to grapple with the ineffable
itself, and see if we may not eff it after all." (Dirk Gently)
--

Xref: sparky comp.lang.c:16733 comp.software-eng:4373
From: claird@NeoSoft.com (Cameron Laird)
Newsgroups: comp.lang.c,comp.software-eng
Subject: Corporate profile (was: Will we keep ignoring this productivity issue?)
Date: 18 Nov 92 15:36:50 GMT
Article-I.D.: NeoSoft.Bxx4pF.Auy
Followup-To: comp.software-eng
Organization: NeoSoft Communications Services -- (713) 684-5900

In article <1992Nov17.165937.10874@sei.cmu.edu> bwb@sei.cmu.edu (Bruce Benson) writes:
			.
			.
			.
>This might not be the best approach for the leading/bleeding edge software
>company (MS, Borland, etc.) but for the average business that uses software 
>to support their primary business, I suspect it works well.  Of course, 
			.
			.
			.
Serious question:  is Microsoft at the leading edge?

My impression is that Microsoft products do *not*
exhibit much technical innovation; architecturally,
they are more on the monumental, than on the artistic,
side.  Is this what others see?  I've also been led
to believe that Microsoft is quite ... relaxed in
their practices of software engineering; they rely
heavily on youngsters, they code away with relative
abandon, and they don't meet their own goals for
resource allocation (of time, especially).  Anyone
know?  Perhaps focussing on specifics of a high-
profile case will help us understand some of the
productivity issues we're debating.
-- 

Cameron Laird
claird@Neosoft.com (claird%Neosoft.com@uunet.uu.net)	+1 713 267 7966
claird@litwin.com (claird%litwin.com@uunet.uu.net)  	+1 713 996 8546
From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
Newsgroups: comp.lang.c
Subject: Re: Multiple Parameter Passing (unspecified number)
Date: 18 Nov 92 11:36:42 GMT
Organization: McGill Research Centre for Intelligent Machines

In article <1992Nov17.105837.21867@henson.cc.wwu.edu>, n8743196@henson.cc.wwu.edu (Jeff Wandling) writes:
> misar@rbg.informatik.th-darmstadt.de (walter misar) writes:
>> In article <92321.124834GNR100@psuvm.psu.edu>, <GNR100@psuvm.psu.edu> writes:

>>> I'm looking to write a function that accepts any number of
>>> paramerter.  [all varying params will be cbar *]
>> [...]
> I'm trying to do a similar thing, except my function doesn't know
> what type to expect.  The next "variable argument" could be any
> simple type.  How do I deal with this?

You don't.  Your function *must* be able to tell, somehow, the type of
each argument; C simply does not give you any choice about this.  It
doesn't matter how.  The example that started this thread knows that
all its varargs arguments are char * a priori.  printf figures it out
from the format string.  You could use global variables or anything
else that'll get this information - but get it you must.

> Is there a way to switch on the type of the next argument?

No, that information is not available to the called function.

					der Mouse

			    mouse@larry.mcrcim.mcgill.edu
Newsgroups: comp.lang.c
From: dfuller@portal.hq.videocart.com (Dave Fuller)
Subject: Re: Questions on kill signal
Organization: VideOcart Inc.
X-Newsreader: Tin 1.1 PL3
Date: Thu, 19 Nov 1992 14:18:54 GMT

isc40038@nusunix1.nus.sg (LIM FANG HOW) writes:
: How to implement a process that when receives a kill signal from the
: shell, will write some characters into a text file ? 
:  
: P.S :
:      This process must be able to receive the kill signal at any point.....


  As far as i know, you can't do anything with a KILL signal. you can't
catch it, block it or do anything else with it. hangups, interrupts,
quits, and others may be caught, but i don't think you can do anything
with a KILL. 

dave fuller
dfuller@portal.hq.videocart.com

Newsgroups: comp.lang.c
From: msb@sq.sq.com (Mark Brader)
Subject: struct hack (was: Is this ANSI?)
Organization: SoftQuad Inc., Toronto, Canada
Date: Sun, 22 Nov 92 13:40:20 GMT

> > 	struct FM { short data_len; char data[1]; } *fmptr;
> > 	fmptr = malloc( sizeof(struct FM) + ??? );
> > 
> > where the ??? is the number of bytes of your data minus 1.  Some may
> > regard this as "impure", but it is not forbidden by the standard and
> > is eminently portable.
> 
> Oh, really?  Can you give me concrete evidence that the C standard allows
> it?  More specifically, after executing the code above, can you give me
> evidence that referrint to fmptr->data[i] is allowed when i>1?

I'll be very brief here, because we *just* went through this in
*excruciating detail* in comp.std.c, and my typing fingers are
still a bit raw. :-)  I think most people would be either (a)
reading that newsgroup and have been following the discussion
there, or (b) willing to accept the comp.lang.c FAQ list's correct
statement that "the ANSI standard allows it only implicitly", or
(c) willing to take disputes about the FAQ list to *email*.

[1] 4.10.3 and 4.10.3.3 require malloc(), if successful, to return an
    object which may be addressed as an array of any type of object.
[2] 3.3.2.1 makes fmptr->data[i] equivalent to *(fmptr->data + i).
[3] 3.1.2.5 says that a pointer contains a reference to an object and
    says nothing to allow it to possibly containing other information.
    Therefore fmptr->data is equivalent to p+offsetof(struct FM,data)
    where p is the pointer returned by malloc() converted to char *.
[4] 3.3.6 allows an offset to be added to a pointer provided that
    both the original pointer value [here fmptr->data or p+offsetof
    (struct FM,data)] and the result [these expressions plus ???]
    are within the same array object.  In this case, if the result
    is within the array object returned by malloc(), they are within
    the same array object, so the bounds on "data" are irrelevant.

This is different from the case of "int x[5][5]; int i = x[1][7];"
which has been correctly determined in an Interpretation Ruling to
not be allowed under 3.3.6; there is nothing in the standard to allow
this indexing, even though the 25 ints making up "x" are required to
all be adjacent.
-- 
Mark Brader		  "Should array indices start at 0 or 1?  My ecumenical
SoftQuad Inc., Toronto	   compromise of 0.5 was rejected without, I thought,
utzoo!sq!msb, msb@sq.com   proper consideration."  -- Stan Kelly-Bootle

This article is in the public domain.
Newsgroups: comp.lang.c
From: sca@gese.ge14.mdadv.gv.at (Petzi Schweda)
Subject: Re: Source code for database
Originator: sca@gese0n.ge14.mdadv.gv.at
Organization: MD-ADV, Vienna, Austria
Distribution: usa
Date: Mon, 23 Nov 1992 08:19:40 GMT


A good example would be CodeBase 4.5 by Sequiter Software Inc. (Canada).
It's for MSDOS & WINDOWS and includes sources to access dBase and Foxpro databases.
Although these sources are buggy (by setting the compilerswitches to 
support old dBase-format it doesn't even compile error-free), they are more or less well structured, straightforward, and contain an C++-interface  (classdefinitions) too ...

have fun, Petzi

Petzi Schweda (sca@gese.ge14.mdadv.gv.at)
MD-ADV, Municipality of the City of Vienna, Austria
Newsgroups: comp.lang.c,comp.software-eng
From: mzimmers@netcom.com (Michael Zimmers)
Subject: Re: Wanted: Supported equivalent of FileMerge
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
Date: Fri, 20 Nov 1992 05:41:49 GMT

In article <1992Nov20.015605.10416@spectrum.xerox.com> leisner@eso.mc.xerox.com writes:

>Doug Valkenaar (dougv@vnet.ibm.com) wrote:

>: Does anyone know of a "FileMerge" type program which allows you to visually
>: merge two files into a third one with selected parts from each of the
>: originals?  SUN used to distribute such a program, but it's only SunView
>: (I'd like OpenLook), and it's no longer supported.

>GNU diff is quite impressive and has excellent and extensive documentation!! 

I haven't seen GNU diff, but the mere fact that is needs extensive
documentation implies that it's inconsistent with Scott McGregor's
stated objective for programming tools, that a tool ought to be easy
to install, easy to learn and easy to use.  His company's Mergeahead
comes with a one-page installation sheet and online help, and that's 
it (and that's enough).
-- 
Michael Zimmers                                    |  Home:  408 996 1984
SoftHelp                                           |  Work:  408 996 1965
Software Solutions for Open Systems                |  Data:  408 996 1974
Newsgroups: comp.lang.c