HDTenEightyP/NetNews huggingface dataset:
From: tomg@code3.com (Tom Green)
Subject: Re: atexit exit call order
Organization: 3M Health Information Systems
Date: Wed, 8 Apr 1992 15:29:11 GMT

In article <etxolpn.702714110@beppe22> etxolpn@beppe22.ericsson.se (Ola Persson) writes:
>
>	Hello world!
>
>I'm using Sun ansic compiler and the function atexit. Does anybody know in
>which order the exit handlers are called when i establish more than one. Is
>this behaviour compatible?

atexit() calls are processed in a lifo order.


-- 
Tom Green
- Life's a pain, then you die.                            _/_ __ ____ __
  "I shall be merciful and quick" - the Gorn              /  /_// / //_/
tomg@code3.code3.com                                                 _/
Newsgroups: comp.lang.c
From: steve@taumet.com (Steve Clamage)
Subject: Re: Is the address of a g
Organization: TauMetric Corporation
Date: Sun, 12 Apr 1992 19:30:34 GMT

matt.johnson@ehbbs.hou.tx.us (Matt Johnson)  writes:

> On 04-08-92 STEVE CLAMAGE wrote to ALL... 

[ Johnson did not quote anything I said, but only what other said... ]

>  Sorry Steve, but with relocateable code, there is no way that the compiler 
>  could know the address of a variable.	For example, using a segmented 
>  architecture, the offset of the variable would be constant - but the 
>  segment would be known only at runtime.	With most of today's computers 
>  able to run several programs at once, how could the compiler of a given 
>  program know what the address of any variable would be for certain before 
>  the program runs? 

The question was whether the address of a static object was a constant.
The answer (in Standard C) is that it is an address constant, which is
legal in certain contexts, but not in all contexts where other kinds
of constants are allowed.  For example, file-level objects may be
initialized only with constant expressions, and an address constant
may be used for this purpose.  On the other hand, an address constant
may not be used in a preprocessor #if expression, nor as a case label
(among other things).

The address of a static variable might more properly be described as a
link-time or load-time constant, rather than a run-time constant.  That
is, the address of such an object does not change once the program has
been loaded into memory and begun execution*.  In the contexts in which
an address constant is allowed, this is sufficient.  In other contexts,
the results of using address constants are undefined.

The complaint that an address constant cannot in general be known at
compile time is irrelevant.  No one on this thread claimed it could.

---
*The physical address might change frequently, but the virtual address
will remain the same.  This is not detectible by a conforming program.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
Vice Chair, ANSI C++ Committee, X3J16
From: pjh@mccc.edu (Pete Holsberg)
Newsgroups: comp.lang.c
Subject: Re: Why aren't my floats passing as doubles?
Date: 14 Apr 92 17:51:24 GMT
Organization: The College On The Other Side Of Route One

In article <1992Apr12.173842.12995@athena.mit.edu> scs@adam.mit.edu writes:
=... the ANSI C Standard explicitly allows implementations
=to pass floats as floats (as long as "new style" function
=declarations and definitions are in use), obsoleting the pre-ANSI
=rule that all floats were promoted to double.

Is it true that *both* prototype declarations *and* ANSI C style
definitions are required? For some reason, I had thought that just the
prototype declaration was sufficient.

Pete
-- 
Prof. Peter J. Holsberg      Mercer County Community College
Voice: 609-586-4800          Engineering Technology, Computers and Math
FAX: 609-586-6944            1200 Old Trenton Road, Trenton, NJ 08690
Internet: pjh@mccc.edu       Trenton Computer Festival: April 17-18, 1993
Xref: sparky comp.lang.c:7314 comp.std.c:1760
From: jfw@ksr.com (John F. Woods)
Newsgroups: comp.lang.c,comp.std.c
Subject: Re: PLEASE don't use "long long" for 64 bits + answer to letter
Date: 7 Apr 92 12:40:11 EDT

abraham@iesd.auc.dk (Per Abrahamsen) writes:
>Doug> Will MIPS make, for their 64 bit machines, as standard, a compiler
>Doug> where sizeof(char) == 1 , sizeof(short) == 2, sizeof(int) == 4 and
>Doug> sizeof(long) == 8, with no "long long" type??
>Doug> IF they do that nobody has any complaint with them if they do, indeed,
>Doug> offer a switch to change sizeof(long) to 4 and add a "long long". I sure
>Doug> don't. 
>Will the C purists really accept a 32 bit int on a machine with a 64
>bit natural word size?

If it doesn't cost any performance, why not?

Of course, if you're really interested in bogus compatability arguments to
select the size of "long", you really ought to insist that int be 16 bits on
64 bit machines, with pointers 16 bits unless you use the "far" keyword to
increase them to 32 bits.......
From: man@magwien.gv.at (Andreas Manessinger)
Newsgroups: comp.lang.c
Subject: Re: C beautifier
Date: 9 Apr 92 13:44:09 GMT
Organization: Gemeinde Wien, MD-ADV/Md Ref. EPS

In article <1992Apr7.001701.28785@seas.gwu.edu> khatri@seas.gwu.edu (Anil Khatri) writes:

   Hi! netters, here is one simple question for you all. Are any of you guys using
   C Beautifier for your C programs. Do you find any other advantage
   of it apart from  easy readibility and debugging of code. 

I always use the `c-mode' of `Emacs' for editing, so my sources are always
pretty :-) Whenever I need to work on other people's sources I feed
them into `GNU indent'. With commandline options you can request a lot
of different indentation styles. There should also be a style for you.
You get `Emacs' and `indent' via anonymous FTP from `prep.ai.mit.edu'
and other major sites. Ports for Maso/Sado-DOS, Atari ST and other
exist.
--
    /\              | eMail: "man@magwien.gv.at"
   /  \ndreas       | pMail: Kaiserstra\3e. 30/26; A-1070 Wien; Austria
  /\/\ \            | Work : Gemeinde Wien MD-ADV/Ma; Ref. EPS
 / /  \anessinger   | Phone: +43 (1) 9350434 or 4039584/13, FAX: 4039584/18
Newsgroups: comp.lang.c
From: shyatt@PFC.Forestry.CA (ARIAKAS)
Subject: TechnoJocks
Reply-To: shyatt@PFC.Forestry.CA
Organization: Forestry Canada (Pacific Forestry Centre)
Date: Tue, 14 Apr 1992 17:40:56 GMT

Hi all. I have seen a product called technojocks for Pascal. It is a source
library I believe. Is there a technojocks package for C language (Turbo C++
in partucular) and if so can I FTP it from someplace?
Steve Hyatt

  STEVE HYATT                       Title: Coop Student - Computer Science
  Forestry Canada                   Phone: (604) 363-0600
  Victoria, B.C.                    Internet: SHYATT@A1.PFC.Forestry.CA
Newsgroups: comp.lang.c
From: cb@tamarack12.timbuk (Chris Brewster)
Subject: Best compiler for learning C?
Organization: pubs
Date: 7 Apr 92 15:27:45 CDT


I'm new to C and need to learn it.  (I won't mention the language I know
already, but it starts with F.)  I'm thinking of buying either MS Quick C
or Turbo C++ for learning.  The selling points are that Quick C apparently
includes some educational features, but Turbo C++ (obviously) includes C++,
which I will also want to learn when/if I feel ready.  Adherence to
standard C would be an advantage.  Please advise; thanks...

Chris Brewster
cb@cray.com
GEnie: C.BREWSTER7

Xref: sparky comp.lang.c:7512 comp.databases:4113
From: ajayshah@alhena.usc.edu (Ajay Shah)
Newsgroups: comp.lang.c,comp.databases
Subject: What is a good special-value to use for "not available"?
Date: 12 Apr 1992 16:41:18 -0700
Organization: University of Southern California, Los Angeles, CA
NNTP-Posting-Host: alhena.usc.edu

I often encounter text files of data, where a field takes the value "."
to mean "not available".  When I read this into a in-core data structure,
I'd like to give it some special value which (we hope) will not ordinarily
occur in data.  What should that special value be?

I have some clues:

1. Maybe use special values like NaN for a IEEE float.
        (E.g. Sun has functions isnan().  The irritation is that
        while the IEEE floating point standard has spread far and
        wide, the standardisation of the C interface to it is very poor.
        So the only path I can think of is to write your own source
        for isnan() etc.).

2. The special value chosen should avoid -FLT_MAX and FLT_MAX since
   programs sometime use these values.

3. Prefer a negative number since they occur much less in data.

4. Better a number like 7.3812 rather than 7.38 since lots of decimals
   occur less in data.

What do you suggest?  Maybe a bit pattern like 1010101?
I'm sure people who deal with databases routinely need to distinguish
between 0 and "not available".  I believe Sybase supports a "not available"
value.  How is it done?

        -ans.
-- 

Ajay Shah, (213)749-8133, ajayshah@usc.edu
From: volpe@bart.crd.ge.com (Christopher R Volpe)
Newsgroups: comp.lang.c
Subject: Re: Clear screen
Date: 6 Apr 92 16:39:53 GMT
Reply-To: volpe@bart.crd.ge.com (Christopher R Volpe)
Organization: GE Corporate R&D Center

In article <1992Apr5.104630.5687@klaava.Helsinki.FI>,
wirzeniu@klaava.Helsinki.FI (Lars Wirzenius) writes:
|>If you want as-portable-as-possible-with-the-least-amount-of-work, use
|>curses.  If you know of a more portable solution (not counting the badly
|>informed attempts to use VT-100 escape codes as a universal solution),
|>please inform the net (or me, at least).

Here's the most portable and strictly conforming way I can think of: (There
may be dumb errors here, I didn't test it, but you get the idea)

#include <stdio.h>
void clear()
{
  int num_lines,i;
  printf("How many lines does your screen have?\n");
  scanf("%d",&num_lines);
  for (i=0;i<num_lines;i++)
    fprintf(stderr,"\n");
}

|>
|>--
|>Lars.Wirzenius@helsinki.fi
                             
==================
Chris Volpe
G.E. Corporate R&D
volpecr@crd.ge.com
From: hackbard@cps3xx.cps.msu.edu (Derek A Hackbardt)
Newsgroups: comp.lang.c
Subject: Linked List Help
Date: 17 Apr 92 09:05:54 GMT
Reply-To: hackbard@frith.egr.msu.edu (Derek A Hackbardt)
Organization: Dept. of Computer Science, Michigan State University
Originator: hackbard@cps3xx.cps.msu.edu

I am looking for a procedure that takes  as a parameter the variable start.
The procedure needs to reverse the order of the linked list so the first is the last and the last is the first.

The data structure used is "
	struct node {
		int data;
		struct node *link;
	} *p, *start, *next;



I need this help as soon as possible.
Thank you,


Derek A. Hackbardt
Michigan State University, Dept. of Computer Science.
Xref: sparky comp.lang.c:7316 news.newusers.questions:2232
From: scs@adam.mit.edu (Steve Summit)
Newsgroups: comp.lang.c,news.newusers.questions
Subject: Re: Redirecting followups (was: Please read before posting)
Summary: more non-C netiquette
Date: 7 Apr 92 18:58:34 GMT
Reply-To: scs@adam.mit.edu
Followup-To: news.newusers.questions
Organization: none, at the moment

In article <1992Apr4.082625.6117@sq.sq.com> msb@sq.sq.com (Mark Brader) writes:
> For example, someone asks a UNIX-specific question in comp.lang.c only.
> Your followup might look like this:
> [example omitted]

Mark's right, but since inappropriate questions are often
frequently-asked questions, a bit of "do unto other newsgroups as
you would have them do unto you" is in order.  Consider how many
times a noxious, eternal debate such as how-to-do-null-pointers-right
has flared up yet again in comp.lang.c because a question was
asked in an os.programmer group and someone "helpfully"
redirected the discussion to comp.lang.c, "where it belongs."

When someone asks a question which you know is inappropriate and
which you know (or suspect) is also frequently asked, send the
person e-mail, letting them know the name of the more-appropriate
group, and suggesting that they check the FAQ list there (if any)
first.

Followups to inappropriate or frequently-asked questions are
themselves usually inappropriate.

					Steve Summit
					scs@adam.mit.edu
From: dons@hpmwtd.HP.COM (Donald St.Denis)
Date: Wed, 8 Apr 1992 21:34:28 GMT
Subject: Re: Returning the highest bit set in a long
Organization: HP Santa Rosa Site (NMD MTA MWTD). - Santa Rosa, Ca.
Newsgroups: comp.lang.c

>/ hpmwtpd8:comp.lang.c / gor@cs.strath.ac.uk (Gordon Russell) / Apr  8, 1992 /
>
>   I am hoping that someone out there has an algorithm for calculating
>the highest bit set within a long, in terms of its bit position.
>Naturally, there are two obvious solutions; ie
>  (1) A loop to physically examine each bit in turn.
>  (2) A look-up table.

   (3) binary search?


   if (val != 0) {
       if ((val & 0FFFF0000) != 0) {
           if ((val & 0FF000000) != 0) {
               if ((val & 0xF0000000) != 0) {
                   if ((val & 0xC0000000) != 0) {
                       if ((val & 0x80000000) != 0) {
                           it's bit 31;
                       } else {
                           it's bit 29;
                       }
                    } else {
...
           if ((val & 0FF000000) != 0) {
       } else {         /* it's in lower word */
...

>Both of these solutions are far from satisfactory, since speed is essential

    How about 1 comparison to zero, then 5 bitwise and/conditional
    jumps?

>(and efficient memory usage desirable). Please help

    Not great, but not too bad --
        1  conditional for the zero compare
        17 and/conditional jumps for the "search"

>  Gordon
--
Donald St. Denis                		Hewlett-Packard
Telephone: US (707) 577 3364		        Microwave Technology Division
Fax: US (707) 577 5221  			1412 Fountaingrove Parkway
Un*x email: dons@hpmwtd.sr.hp.com		Santa Rosa, CA  95403-1788
HP Desk: STDENIS_DONALD/HP4500_UM@sr.hp.com     Mailstop: 1US-K (Bay Area)

*The three most dangerous things in the world are a programmer with a
 soldering iron, a hardware type with a program patch and a user with
 an idea.
                -- Anonymous
From: psr@acsu.buffalo.edu (Ben the Crafter)
Newsgroups: comp.lang.c
Subject: Re: Best compiler for learning C?
Date: 14 Apr 92 17:15:22 GMT
Organization: UB

cb@tamarack12.timbuk (Chris Brewster) writes:


>I'm new to C and need to learn it.  (I won't mention the language I know
>already, but it starts with F.)  I'm thinking of buying either MS Quick C
>or Turbo C++ for learning.  The selling points are that Quick C apparently
>includes some educational features, but Turbo C++ (obviously) includes C++,
>which I will also want to learn when/if I feel ready.  Adherence to
>standard C would be an advantage.  Please advise;

I taught myself C using only Turbo C++, which has fantastic cross-referenced help screens complete with sample programs and great debugging feeatures, and with The Waite Group's Turbo C Bible.  These two resources are all anyone ever needs.



-- 
Strider                     | SUNY @ Buffalo | psr@acsu.buffalo.edu
Lord Mayor, The Hill People | (716) 636 4862 | V127MHSK@ubvms.bitnet

Tomorrow will be canceled due to lack of interest.
Newsgroups: comp.lang.c
From: rkohli@aardvark.ucs.uoknor.edu (I ain't broke, but I'm badly bent)
Subject: Vax C problem
News-Software: VAX/VMS VNEWS 1.41    
Keywords:  For VAX C officiandos!!!!!
Organization: University of Oklahoma - University Computing Services
Date: Fri, 10 Apr 1992 18:48:00 GMT


Greetings all,
   I have tried to figure out this problem but I don't seem to find a solution
to it. Could someone help me figure it out.

This is what I want to do, read in a user supplied time in the date-time format,
convert it to binary using SYS$BINTIM so that I then pass it to SYS$WAKE in 
another function. 

Now this is what happens, I read the supplied time pass it to the function below
for conversion. The only problem is that I can't get it to convert right. It 
converts only the Date part and not the time part. The second thing is the
additional check to see if the conversion was done right is the SYS$ASCTIM and
that doesn't work right too.

If you need any further clarifications or the rest of the program let me know.

************* Please E-MAIL as I don't read this group to often ************  

/* ALARM.C */


quadword convt_ascii_bin(char *as_tim)
{ 
  char *as__temp;
  quad as_tim_temp;
  $DESCRIPTOR(as_tim_desc, as_tim);
  $DESCRIPTOR(as_tim_desc_temp, as__temp);
  quadword bin_tim_struct;

  register status;

  printf("\nInput time passed to convt_ascii_bin() is: %s\n", as_tim);

  if (((status=SYS$BINTIM(&as_tim_desc, bin_tim)) &1) != 1) {
    LIB$STOP(status);
  }

  printf("\nBin_tim - (SYS$BINTIM) HEX: %lx%lx\n",bin_tim[0],bin_tim[1]);

  /* sys$asctim is to check if the ascii-bin conversion was 
     done correctly, for now it doesn't seem so because I get the mess ASCTIM 
     FAILURE.
  */  

  as_tim_temp[0] = bin_tim[0];
  as_tim_temp[1] = bin_tim[1];

  printf("\nas_tim_temp : %lx%lx\n",as_tim_temp[0],as_tim_temp[1]);

/* Just to check if BINTIM worked right. */

  status=sys$asctim(0,&as_tim_desc_temp,&as_tim_temp,0);
  if(status != SS$_NORMAL)
  {
    printf("\nAsctim failure while in bin_tim.\n");
  }
 else
  {
       printf("\nBin_tim Ascii coversion(in asctobin): %s\n", as__temp);
  }

  bin_tim_struct.word[0] = bin_tim[0];
  bin_tim_struct.word[1] = bin_tim[1];

  return(bin_tim_struct);
}  








Newsgroups: comp.lang.c
From: CONSLT24@Zeus.unomaha.edu (Issa El-Hazin)
Subject: Need help on how to use fflush(stdin) in VMS C.
Organization: University of Nebraska at Omaha
Date: Wed, 8 Apr 1992 05:19:31 GMT
X-News-Reader: VMS NEWS 1.11

Does anybody know how to flush the stdin in VMS 'C'? I'm using the system();
function to run a command and would like to flush any key(s) the user might
press while waiting for the command to complete (esp. since the system(); call
takes a long time to spawn and run if there are too many people on the system
(Is there a faster alternative to using the system() call? I'm using VMS 5.4.3)
Also if anybody knows how to disable the Ctrl-Y and Ctrl-Z from within a 'C'
program I would be greatly appreciative. I'm modifying a VMS menu program (5000
lines) that I've wrote and if anybody is interested in running it they can do
so by telneting to zeus.unomaha.edu and login as a guest then typing "window"
at the $. The program is located in perm$5:[conslt24.public]. Please feel
free to use or to get a copy of it. Back to my question I'm doing something
similar to the next program and I can't figure out why it's not working.


#include <stdio.h>

main()
{

char test;
int array[10];

	printf("\n Type a letter: ");
	scanf("%c",&test);	/* wait until I'm ready		      */

	sleep(5);		/* while waiting for 5 seconds        */
				/* Type a string and press <enter>    */

	fflush(stdin);		/* flush standard input (keyboard)   */

	scanf("%s",&array);	/* read what's in the input buffer    */

	printf("\n%s",array);	/* will print the string typed before */
				/* flushing the stdin		      */
}


Any suggestions are welcomed and are greatly appreciated.

Thanks in advance

/-Issa-/
Xref: sparky comp.lang.c:7490 comp.windows.ms.programmer:5350
From: ajayshah@alhena.usc.edu (Ajay Shah)
Newsgroups: comp.lang.c,comp.windows.ms.programmer
Subject: Please.  (Was Re: I Hope the BC++ IDE Editor Supports OLE Soon)
Date: 11 Apr 1992 11:53:59 -0700
Organization: University of Southern California, Los Angeles, CA
NNTP-Posting-Host: alhena.usc.edu

ebergman@isis.cs.du.edu (Eric Bergman-Terrell) writes:

>I'm excited about the potential for using OLE in a compiler's text editor.
>In addition to leaving voice annotations, etc., documentation could be inserted
>in-line.  The documentation could be diagrams, word processor text, voice 
>samples, even animated video.

I sure hope I don't encounter your source code someday when I'm alone
in a dark ftp site.

>Perhaps one of the reasons we programmers are often reluctant to write
>in-line documentation is that the tools (tty-style editors) are so primitive.

A tool like Emacs can hardly be called primitive, and the fundamental
barrier for 90% of people is that they have not invested enough time
and thought about programming.  Just like fancy debuggers don't turn a
bad programmer into a good one, animated commercials inside source
code won't either.

Programming is intrinsically hard.  What you are talking about is YA
distraction which detracts from the basic focus which a good programmer
should be obsessed about; i.e., his algorithms, his data structures,
his code quality.

A good applications package may yearn for it's users spending 
many an afternoon hitting buttons, but as a programmer I avoid
such "user friendly" toys.

User friendly -- you spend 15 minutes learning how to use it, and
the rest of your life struggling to get your job done.

>I'd really like to insert a drawing to describe the interesting data structures
>in my programs.  Animation might be overkill, but imagine how it would help
>someone else understand the code!
Have you read Rob Pike on "excessive comments"?

>IN SUMMARY:  Compiler vendors (Borland, Microsoft, etc):  Please support OLE
>in future releases of your compilers' text editors.  No need to do anything
>terribly fancy - just allow users to embed objects and don't compile them!
If you do so, please have an option to strip the gunk on demand.

"Thrilled writing C with Emacs"

        -ans.
-- 

Ajay Shah, (213)749-8133, ajayshah@usc.edu
Xref: sparky comp.lang.c:7347 comp.sys.mac.programmer:7915
From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
Newsgroups: comp.lang.c,comp.sys.mac.programmer
Subject: Re: Problem De-allocating Memory in variable sized arrays
Date: 8 Apr 92 09:40:29 GMT
	<1992Apr6.103745.28462@bronze.ucs.indiana.edu>
	<1992Apr7.173543.821@bronze.ucs.indiana.edu>
Organization: Royal Institute of Technology, Stockholm, Sweden
Originator: d88-jwa@hemul.nada.kth.se

> harlan@copper.ucs.indiana.edu (Pete Harlan) writes:

   |>unsigned char  	**DATA;
   |>
   |>	register i;
   |>
   |>	DATA = (unsigned char **) NewPtr(NROW * sizeof(unsigned char *));

DATA is a pointer to NROW pointers to unsigned char.

   |>	DATA -= 1;	/* to allow indexing starting at 1 */

DATA is decreased one UNIT; where the unit is "pointer" in
this case. Use DATA from 1 to NROW now, not 0 to NROW-1

   |>	for (i = 1; i <= NROW; i++){

See, he loops from 1 to NROW !

   |>	    DATA[i] = (unsigned char *) NewPtr(NCOL * sizeof(unsigned char));

Allocate NCOL chars

   |>	    DATA[i] -= 1;  /* to allow indexing starting at 1 */

Decrease one unit. In this case, the unit is a char. Still OK.

   This is wrong-o, forget the deallocation, you've stomped on memory
   already.  Go back to K&R, do not pass GO, an no $200.

Why ? I see exactly nothing wrong with this.

   |>	for (i = 1; i <= NROW; i++){
   |>	    DisposPtr(DATA[i] + 1);  /* + 1 because of index starting at 1 */
   |>	}
   |>	DisposPtr(DATA + 1);   /* + 1 because of index starting at 1 */

   This is even worse...

Again, why ? He decreased the pointers after assigning them,
now he's increasing them to get back the old values.

   program displays such a magnificent lack of understanding about C
   pointers that no quick fix should be attempted, despite the fact that
   a couple of quick changes will indeed fix this bit (though who knows
   about the rest of the program?)

Okay, I've hacked C for more than six years. I've done stuff not
unlike this myself, and it worked. Have I gotten my C all backward ?

   Not flaming anyone here; C pointers are tricky indeed...

Not especially, after the first two years or so...

Again, I quote you:

   already.  Go back to K&R, do not pass GO, an no $200.

Are you sure it's the original poster who should go back to K&R.
If he should, I should too, it seems.

-- 
h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
Newsgroups: comp.lang.c