HDTenEightyP/NetNews huggingface dataset:
From: bhoughto@sedona.intel.com (Blair P. Houghton)
Newsgroups: comp.lang.c,comp.std.c
Subject: Re: assert
Followup-To: comp.std.c
Date: 22 Dec 1992 16:39:37 GMT
Organization: Intel Corp., Chandler, Arizona
NNTP-Posting-Host: stealth.intel.com

Note the redirection.

In article <9212211543.PN29748@LL.MIT.EDU> lebrun@ll.mit.edu (Steven F. LeBrun) writes:
>I would think that standard header files
>including other standard header files is almost a necessity in order that 
>standard header files may be include in any order and still keep the 
>standard header files as simple as practical.

Headers are to be designed to be includable more than once,
and in any order.  This means that each one should be
independent of the others, to the programmer.  That is, you
don't have to include stdio.h to use assert.h.  It's not
specified how this is accomplished, and presumably you
could implement crossovers by including standard headers in
other standard headers, but I don't see any places where
it's absolutely necessary, if you use #ifndef carefully.

But--and this is a big but--the identifier definitions in a
standard header should be seen by the program if and only
if the programmer explicitly includes that header.
Otherwise the programmer should expect that they are not
yet used.

So if assert.h does need something from stdio.h, that
something had better be in a namespace the user isn't
allowed to use reliably (things starting with '_[A-Z]',
for instance).

The fifth bullet in section 4.1.2.1, Reserved Identifiers,
gives the programmer leave to define things like `isalnum'
and `offsetof' when ctype.h and stddef.h are not included
explicitly.

>If there is a section in the ANSI C standard that explicitly, or 
>implicitly, states that one standard header file can not include
>another standard header file, I would like to know about it.  Please,
>email the section number.

4.1.2 and 4.1.2.1 don't say that, exactly, they just say
that the implementation has to act as though it doesn't
happen.

				--Blair
				  "Or so it would seem."
Newsgroups: comp.lang.c
From: fburton@nyx.cs.du.edu (Francis Burton)
Subject: Re: C code Layout
Organization: Nyx, Public Access Unix @ U. of Denver Math/CS dept.
Date: Wed, 23 Dec 92 22:44:36 GMT

Richard Hartmann writes:

>... am I in the minority here by preferring style C:
>
>        keyword (condition)
>                {
>                statement1;
>                statement2;
>                statement3;
>                }
>

Why not add in the "economy of vertical space" argument to get:

         keyword (condition) {
                 statement1;
                 statement2;
                 statement3;
                 }

Which is my indentation style.  I got the habit from "Software
Tools" by Kernighan and Plauger.  Their Ratfor "language" provided
me with a welcome escape from FORTRAN, before I acquired a useable
C compiler.

However, I never see code using this style nowadays, and indent(1)
does not support it (I think).  Why is it so unpopular when it has
so much going for it? 

--
Francis Burton      Physiology, Glasgow University, Glasgow G12 8QQ, Scotland.
041 339 8855 x8085  | JANET: F.L.Burton@glasgow.ac.uk  !net: via mcsun & uknet
"A horse! A horse!" | INTERNET: via nsfnet-relay.ac.uk BITNET: via UKACRL
Newsgroups: comp.lang.c
From: mccall@mksol.dseg.ti.com (fred j mccall 575-3539)
Subject: Re: Newbie Wants Advice on C-Programming
Organization: Texas Instruments Inc
Distribution: usa
Date: Mon, 28 Dec 1992 16:44:45 GMT

In <1992Dec24.183009.26398@aio.jsc.nasa.gov> begley@l14h13.jsc.nasa.gov writes:

>In article <1992Dec24.172333.7339@grebyn.com> malak@grebyn.com (Michael Malak)
>writes:
>>In article <1992Dec23.220530.15347@netcom.com> noring@netcom.com (Jon Noring)
>writes:
>>>2) We want to do most of our programming on our 386-33 PC running MSDOS 5.0.
>>>   What C-type compilers exist for the PC?  Which ones are better?  How much
>>>   do they cost and where can one get them at a discount?
>>
>>In any case, you should get MASM 6.0, which lists for $150.  It is both
>>a 16-bit and a 32-bit assembler and can link with Microsoft, Borland,
>>and Intel C compilers.
>>
>>The Intel C Code Builder lists for $595.  I'm not sure of the prices for
>>Microsoft C++ and Borland C++, but I imagine they are $300 - $500. 
>>
>   Ignoring the basic premise of your question (PC based), I have really
>been surprized by the prices people have quoted here for PC C compilers.
>The Mac hardware price is much higher than PC prices, but I expected
>software to be about the same.  In the Mac world, there are 4 or 5 C
>compilers, with the major two being Think C  and MPW (Mac Programmer's
>Workshop).  Think C has a street price of $199, and by buying the $35
>"Learning C on the Mac" book (which comes with "Thin C", a slim version
>of Think C), the upgrade to THink C is only $129.  I hear Think C sells
>for $99 to students.  Think is a fine programming environment, with
>compiler, linker, editer, and debugger rolled into one.  So why are
>the PC compilers so much more?

The prices being quoted for PC compilers generally include a lot more
tools than just the compiler (profilers, C++, various class libraries,
assembler, debugger, etc.).

-- 
"Insisting on perfect safety is for people who don't have the balls to live
 in the real world."   -- Mary Shafer, NASA Ames Dryden
------------------------------------------------------------------------------
Fred.McCall@dseg.ti.com - I don't speak for others and they don't speak for me.
Newsgroups: comp.lang.c
From: woods@robohack.UUCP (Greg A. Woods)
Subject: Re: SCCS eats good code -- help requested
Organization: Elegant Communications Inc.
Date: Sat, 26 Dec 92 06:17:49 GMT

In article <1992Dec20.201522.28201@lorelei.approve.se> hoh@lorelei.approve.se (Goran Larsson) writes:
> The handling of these version strings is in itself a very good reason
> to avoid SCCS. The decision to only expand version strings when compiling
> is wrong. If I send source to someone, I want to expand version strings
> so "someone" can report problems - but "someone" might also want to

It's also a very good reason to *use* SCCS.

SCCS provides infinitely more flexible keyword expansion and report
generation than RCS.

> 1) find /usr -name sccs -exec rm -rf {} \;

Very, very, silly thing to even suggest!

> 2) Install RCS

Good plan!  And if you buy lots of machines from a vendor who doesn't
support the latest versions of such tools, then lobby them to do so!

> 3) Use RCS

Sorry, wong!  :-)

What you really want to do is also hide RCS behind an even better tool:

4) install CVS-1.3

5) use CVS!

> btw  :-)

Only 0.5 :-)!

-- 
						Greg A. Woods

woods@robohack.UUCP, woods@Elegant.COM  VE3TCP	UniForum Canada & ECI
+1 416 443-1734 [home] +1 416 362-XRSA [work]	Toronto, Ontario; CANADA
From: venky@sybase.com (Venky)
Newsgroups: comp.lang.c
Subject: Re: Finding the number of days between two dates
Date: 30 Dec 92 18:15:34 GMT
Organization: Sybase, Inc.

In article <1992Dec10.181940.10135@linus.mitre.org> jrv@truth.mitre.org (Van Zandt) writes:
>In article <1992Dec9.011317.26944@klaava.Helsinki.FI> wirzeniu@klaava.Helsinki.FI (Lars Wirzenius) writes:
>>pjh@cs.tut.fi (Haavisto Petri) writes:
>>>1. When using mktime(), is it necessary to set all fields of the
>>>tm-structure to correct values? 
>>
>>No.  tm_wday and tm_yday (and tm_isdst?) are computed by mktime based
>>on the other fields.  In fact, the required fields do not have to be
>>in their required fields either, mktime normalises them.  
>
>The Borland docs claim their mktime() normalizes those values, but
>it doesn't.  (I'm posting a separate msg on that.)  My "Osborne McGraw-Hill
>C the Complete Reference" doesn't mention the normalization.  Is it required
>by the standard?
>
>                           - Jim Van Zandt <jrv@mitre.org>

  
  ANSI Standard requires that tm_wday and tm_yday be computed 
  based on the other fields in the 'struct tm'. I have seen 
  that most versions of Unix do not support that, though.
  
  The latest HP-UX 9.0 however, has got this fix and works 
  well. I should know.....
  
  As regards tm_isdst, the daylight savings time adjustment,
  I don't think it is implicitly calculated. It is an input 
  from the user. I remember using an environment variable 
  ( TZ_DST  ?) to be assigned to tm_isdst ( with HP-UX ). 
  
  Thanx!
  Venky
Newsgroups: comp.lang.c
From: mccall@mksol.dseg.ti.com (fred j mccall 575-3539)
Subject: Re: Float point format not loaded?
Organization: Texas Instruments Inc
Date: Mon, 28 Dec 1992 17:46:34 GMT

In <1he75eINNmlg@uwm.edu> pegasus@csd4.csd.uwm.edu (David R Hucke) writes:

>Hi everybody!

>I am having a problem with Turbo C 2.0.

>I am writing a program that does some float calculations and when I run the
>program I get a run-time error saying:  Floating point formats not loaded.
>Abnormal termination.

>I have included math.h  float.h and even declared a float variable.

>The problem appears on a scanf instruction.

>Any ideas how to clear up this little problem?

Try DOING something with the fp variable that you declared (assign to
it or something).  Otherwise, the floating point libraries don't get
linked in.

I think this may be in the FAQ -- it is asked that often.

-- 
"Insisting on perfect safety is for people who don't have the balls to live
 in the real world."   -- Mary Shafer, NASA Ames Dryden
------------------------------------------------------------------------------
Fred.McCall@dseg.ti.com - I don't speak for others and they don't speak for me.
Newsgroups: comp.lang.c
From: mliu@pt.com (Fred Liu)
Subject: Re: C code Layout
Organization: Performance Technologies, Incorporated
Distribution: usa
Date: Thu, 24 Dec 1992 14:23:40 GMT

In article <BzqIHE.7p3@rahul.net> kpapai@rahul.net (Ken Papai) writes:
>nmp@mfltd.co.uk (Nic Percival (x5336)) writes:
>
>and I like style C format too:
>
>    if (editor == BRIEF)
>         {
>         printf( "You are a lucky software engineer.\n" );
>         printf( "You will be rewarded handsomely because you are so 
>                  productive!")
>         }

I can agree with this, although I don't use this style.

>    else
>         printf( "You are an unlucky VI or EMACS user. Sorry..." ); 

I don't like this.  I always rather use

>    else {
>         printf( "You are an unlucky VI or EMACS user. Sorry..." ); 
	 }

In my C programming practice, "if ()" and "} else ()" are always
followed by {.  It allows me to insert and delete printfs inside a
if with least bothering to other code, and it does not take to much
time and space to do that.

-- 
Fred Liu, Performance Technologies Incorporated		mliu@pt.com
315 Science Parkway, Rochester, New York 14620		uupsi!ptsys1!mliu
Newsgroups: comp.lang.c
From: jja@fnbc.com (Joseph Alotta)
Subject: does anyone have sample socket programs to share?
Keywords: sockets, ipc,help
Organization: First National Bank Of Chicago, Chicago IL, USA
Date: Mon, 28 Dec 92 20:04:10 GMT

Greetings,


I'm not a heavy c hacker, but I want to write a client-server
program using socket communications.

Does anyone have something that:

1.	Will compile on Sun/OS.
2.	Does 2 way socket traffic.
3.	Uses the select statement.
4.	Is very reliable.  ie avoids deadlock, and all the
	other bad things.
5.    	has little other stuff in it. 


I will be most grateful,


joe.

please email me directly, there is just too much going on here
in comp.lang.c for me to see everything.




==============================================================
! joe alotta                                    jja@fnbc.com !                                               
!                                             (312) 732-3439 !
!                                                            !
! "The main thing is to keep the main thing the main thing." !
! Dr. George Sweeney                                         !
==============================================================
From: gordon@siemens.com. (Igor Gordon)
Newsgroups: comp.lang.c
Subject: Looking for software to test CMs
Date: 21 Dec 92 22:23:30 GMT



We are in the process of evaluating several CM systems. I am looking for
software (source + [repository] + make files) to be used in the evaluation 
process.

Could anyone point me in the right direction for public domain
software that I could use for my purposes. The desirable characteristics
of such software are, in order of importance:

1. Number of modules (files): 500 -  3000

2. Executables are built using make

3. The software is organized hierarchally (not all files are
   dumped into one directory).

4. Language C/C++ (other languages are ok if public domain
   compilers are avaiable on Sun).

5. Large number of versions per file.

Pointers to any reasonably large piece of software are appriciated, 
even if it does not meet the above criteria.

-----------------------------------------------------------------
I speak only for myself

Igor V. Gordon			tel:   (609) 734-3321
Siemens Corporate Research      fax:   (690) 734-6565
Princeton NJ			email: gordon@siemens.siemens.com



Newsgroups: comp.lang.c
From: bandy@netnews.jhuapl.edu (Mike Bandy)
Subject: Re: What's wrong with this code...???
Organization: JHU/Applied Physics Laboratory
Date: Mon, 28 Dec 1992 14:37:29 GMT

ctaylor@cs.uiuc.edu (Conrad Taylor) writes:


>    Question: why would the 'free(p)' in 'main' cause this program to go
>into an infinite loop?

The code all looks good, but you're free()ing p twice.  Also, once
p is free'ed, your linked list continues to point to the memory that
was dealloced - that's illegal.  You should remove p from the 
linked list, then deallocate p *once*.

>-------------------------------- Cut Here ------------------------------------

>INT main(void)
>{
>   NODEPTR head;
>   NODEPTR p;

>   head = (NODEPTR)malloc(sizeof(struct NODE));
>   head->prev = head;
>   head->next = head;
>   head->info = -2;

>   p = GetNewNode();
>   p->info = 1;
>   DoublyLinkedInsert(p, head);

>   p = GetNewNode();
>   p->info = 2;
>   DoublyLinkedInsert(p, head);
>   free(p); /* This is the line of code that I'm talking about above. */

>   DoublyLinkedPrint(head);

>   free(head);
>   free(p);

>   return 0;
>}
-- 

	Mike Bandy
	bandy@aplcomm.jhuapl.edu
	Johns Hopkins University / Applied Physics Lab
From: robohen@ocf.berkeley.edu (Henry Robertson)
Newsgroups: comp.lang.c
Subject: C Cartwheel program help
Date: 30 Dec 1992 14:09:18 GMT
Organization: U. C. Berkeley Open Computing Facility
NNTP-Posting-Host: headcrash.berkeley.edu

Thanks for all the help you gave me, people!  I think I've figured it out
now.
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.lang.c
Subject: Re: Questions about token merging and trigraphs
Date: 23 Dec 92 03:56:50 GMT
Organization: Comp Sci, RMIT, Melbourne, Australia

In article <yoF4VB1w165w@quest.UUCP>, kdq@quest.UUCP (Kevin D. Quitt) writes:
>     Would you like to post some of the CODE that got broken?
> Considering that ?? is *not* legal anywhere in C (except in comments,
> strings and header names) I doubt you can do it.

Here is a program which was legal in K&R C and may misbehave rather
seriously in ANSI C.  (As it happens, I _have_ on occasion used "?"s
as place-holders to be overwritten.  These days I use "X"s.)  ??/ was
also likely to appear in filename templates.

char filename[] = "D??-??-??";

void fill02d(p, n) char *p; int n;
{ p[0] = (n/10)%10 + '0'; p[1] = n%10 + '0'; }
	
void mkfilename(y, m, d) int y, m, d;
{ fill02d(filename+1, y); fill02d(filename+4, m); fill02d(filename+7, d); }

In K&R C, the call mkfilename(1992, 12, 23) resulted in filename
containing "D92-12-23".  In ANSI C, strlen(filename) starts out at 5,
so the last call to fill02d isn't going to work very well.

It is so easy to check for unintended digraphs and so easy to fix them
that I don't actually worry about this.  I do find it amusing, though,
that the easy fix (changing ?? to ?\?) involves one of the very characters
that has a trigraph (??/ => \).  Suppose we decide to use the trigraph for
backslash, and instead of writing ?\? write ???/?.  Unfortunately, that
won't be parsed correctly, because ??? is not one of the recognised
trigraphs, it will be left untouched.  You _must_ use ?\? or string
pasting to break up the question marks.  And if you _can_ use ?\?, you
didn't need trigraphs.
Newsgroups: comp.lang.c
From: ktf@bc3.GUN.de (Klaus ter Fehn)
Subject: Re: What's wrong with this code...???
Organization: private
Date: Thu, 24 Dec 1992 15:06:46 GMT


>Question: why would the 'free(p)' in 'main' cause this program to go
>into an infinite loop?  I have enclosed complete source and not an abstract
>that can be viewed.  Also, how would one break out of an infinite loop in
>BBorland C/C++ 3.1? Thanks in advance to all that reply to this post.

Question: Why do you free memory that contains data which is linked to your
	  linked-list ?

   (...)

   p = GetNewNode();
   p->info = 2;
   DoublyLinkedInsert(p, head);
   free(p); /* This is the line of code that I'm talking about above. */
	    /* me too :-) */

   (...)

   Let's see, if I understand your program:

   you have a pointer

     p
   ,---.
   |   |
   `---'

   you call GetNewNode() to allocate memory for informations (here: 2)

     p		SOMEWHERE
   ,---.       ,-----------.
   | o-+------>|     2     |
   `---'       +-----+-----+
               |     |     |
	       `-----+-----'

   after doing so, you insert the structure into your list:

     q		
   ,---.       ,-----------.
   | o-+------>|     ?     |
   `---'       +-----+-----+
               |  o  |     |
	       `--+--+-----' _
                  |         |\
     p           \|/          |
   ,---.       ,-----------.  |
   | o-+------>|     2     |  |
   `---'       +-----+-----+  |
               |  o  |  o--+--'
	       `--+--+-----' _
                  |         |\
                 \|/          |
               ,-----------.  |
               |     ?     |  |
               +-----+-----+  |
               |     |  o--+--'
	       `-----+-----'

   and the, you free the memory pointed to by 'p':

      		
               ,-----------.
               |     ?     |
               +-----+-----+
               |  o  |     |
	       `--+--+-----'
                  |
     p           \|/
   ,---.                       
   | o-+------>  UNDEFINED
   `---'          MEMORY
                 CONTENTS!
	                     _
                            |\
                              |
               ,-----------.  |
               |     ?     |  |
               +-----+-----+  |
               |     |  o--+--'
	       `-----+-----'

   WHY ?!?

Merry X-Mas!
-- 
Klaus ter Fehn		<ktf@bc3.GUN.de>
Neanderstr. 4		{mcshh,smurf,unido}!easix!bc3!ktf
4000 Duesseldorf 1
FRG / Germany		Tel.: +49-211-676331
-- 
Klaus ter Fehn		<ktf@bc3.GUN.de>
Neanderstr. 4		{mcshh,smurf,unido}!easix!bc3!ktf
4000 Duesseldorf 1
FRG / Germany		Tel.: +49-211-676331
From: slgyp@cc.usu.edu (Doran L. Barton)
Newsgroups: comp.lang.c
Subject: Re: A good book on C ?
Date: 30 Dec 92 15:08:03 MDT
Organization: Utah State University - Electrical/Computer Engineering

In article <1hq64pINNf80@rave.larc.nasa.gov>, wjb@cscsun2.larc.nasa.gov (William J. Bene) writes:
> Other than K&R, are there any other C reference manuals that anyone cares to 
> recommend?
> 
> 
        One that I have found to be fairly useful- and I have taught courses
        with this book is:

        C - The Complete Reference
        Author: Herbert Schiltd
        Pub: Osborne-McGraw Hil
        Price: 29.95
        Can't remember ISBN

        It is about 6 cm thick and provides a wealth of tutorial information
        and reference to beginning and intermediate C programmers. It is biased
        to DOS programmers, however. If you are not a DOS programmer then I
        would consider a different book before looking into this one. It covers
        C++ as well as graphics, interrupt handling, advanced data structures,
        and professional programming techniques. Mr. Schiltd provides the
        reader with many examples of code, although I found some of them to be
        lacking in efficiency and/or correctness, but it didn't take much for
        me to get them into efficient working order.

        K & R's book is a very good book but is very intimidating to the
        beginning programmer. It is called the ``White Bible'' by those who
        have experience programming. I would suggest purchasing a more
        user-friendly book in the beginning and then obtaining K & R at a later
        date.

        Doran

___ ___   ___   ___ ___        Doran L. Barton - Undergraduate Student
 |   |   |___    |   |         Electrical/Computer Engineering
 |___|=   ___|=  |___|=	       slgyp@cc.usu.edu	/ slgyp@usu.bitnet
College of Engineering_        ``My how time flies when you're dead'' -Anon
Xref: sparky comp.lang.c:19056 comp.lang.pascal:7756
From: joe@proto.com (Joe Huffman)
Newsgroups: comp.lang.c,comp.lang.pascal
Subject: Re: Printer and plotter BGIs wanted !
Date: 31 Dec 92 00:03:45 GMT
Organization: FlashTek, Inc.

graham@taffy.rice.edu (Graham Palmer) writes:

>In article <92350.163535IFF291@DJUKFA11.BITNET>, IFF291@DJUKFA11.BITNET
>(Stephan Petersen) wrote:
>> 
>> I came across some which have the copyright message "Copyright (C)
>> 1989,90 M. K. Fleming" within the BGI-file. Maybe somebody would know
>> which company exactly this stands for?

Fleming Software
Box 569
Oakton, VA 22124

703-591-6451

M. K. Fleming is Marilyn Fleming.  I don't know what the 'K' is for.
See the ads in DDJ, Computer Language, etc.

Tell her, "Joe sent me."

:-)
-- 
netcom!proto!joe
joe@proto.com
Newsgroups: comp.lang.c
From: kaleb@jpl-devvax.jpl.nasa.gov (Kaleb Keithley)
Subject: Re: sccs eats good code -
Organization: Jet Propulsion Laboratory (NASA)
Distribution: comp
Date: Tue, 22 Dec 1992 00:58:28 GMT

In article <1992Dec21.4396.29992@dosgate> "peter curran" <peter.curran@canrem.com> writes:
>In article <1992Dec18.215413.65833@evolving.com> jww@evolving.com
>(John W. Woolley) writes:
>
>>We had a chunk of source so:
>>  if (strftime(time_str, 64, "%w%H%M%S", time_struct) != 7)
>>
>>Nice normal ANSI C.  But SCCS had spotted the string %H% in the
>>above bit of code, and had done its replacement thing so:
>>
>>  if (strftime(time_str, 64, "%w12/14/92M%S", time_struct) != 7)
>>
>A simple solution is to replace the original string with something
>like "%w%\H%\M%\S".  Ugly, but it works.  Unfortunately, it is an
>"active" solution - if you don't notice the problem when you write

I think this bites everyone who uses SCCS.  I agree that Peter's solution is
ugly, because the person who' maintaining the code comes along, doesn't 
immediately recognize why the backslashes are there, and strips them out 
without thinking.  Comments might help, but I think they might be hard
to keep attached with the statement; especially with some of the more
convoluted expressions that some people like to write.  As to why a 
maintenance programmer would change working code... :-)

I like the following, if only because it stands out, and it might be micro-
scopically easier to keep an explanatory comment right there along side it.

  static char frmt[] = '%', 'w', '%', 'H', '%', 'M', '%', 'S', '\0';
  [...]
  if (strftime(time_str, 64, frmt, time_struct) ...

-- 

Kaleb Keithley                               kaleb@jpl-devvax.jpl.nasa.gov

Newsgroups: comp.lang.c
From: sml@mfltd.co.uk (Shaun Lowry)
Subject: Re: C code Layout
Organization: Micro Focus Ltd., Newbury, UK
Distribution: mf
Date: Thu, 24 Dec 1992 09:27:09 GMT


In article <1992Dec23.165659.3298@mfltd.co.uk>, nmp@mfltd.co.uk (Nic Percival (x5336)) writes:
 
> And as for white space I think thats nice too.

ThatsallwellandgoodsolongasyourenotrunninginterpretedcodeinlimitedRAM.

    Mr. BBCBASIC
-- 
/s(Shaun Lowry)def/g{.7 setgray}def/c{10 0 -1 arc fill}def 300 600 100 0 360 arc
stroke 300 600 50 180 0 arc stroke g 300 600 c stroke 1 2 scale 270 325 c stroke
330 325 c stroke grestore 125 450 moveto/Helvetica findfont 60 scalefont setfont
gsave 0.03 .09 rmoveto g [ 1 0 2 -1 0 0 ] concat s show grestore s show showpage