HDTenEightyP/NetNews huggingface dataset:
From: dkeisen@leland.Stanford.EDU (Dave Eisen)
Subject: Re: Moving from Pascal to C, Help please!!!!!!
Organization: Sequoia Peripherals, Inc.
Date: Wed, 6 Jan 93 15:10:28 GMT

In article <4293@dozo.and.nl> jos@and.nl (Jos Horsmeier) writes:

>Then you've just been plain lucky and so were the authors of NRC. 99%
>of all their pointer fiddling (subtracting the lowest index value from a
>pointer) is done with an offset of one. Imagine a segmented memory
>architecture as used in a PC. Global arrays are almost never stored
>at the beginning of a segment, so the offset of the address of such
>an array is always larger than one. Pointer arithmetic is almost always
>done using the offset. The segment value is ignored. The same thing is

My understanding was that Numerical recipes in C used the trick:

#define   Array      (array - 1)

and then indexed the array as Array[1] to Array[n-1].

Yes, array - 1 is illegal. Even when used as Array[1] which
is the same as *(array - 1 + 1). But even if a system uses
segments in such a way that array - 1 is not a valid address,
it is very likely that array - 1 + 1 gives a pointer that
is represented exactly the same way as array is. Even if pointer
arithmetic is done using only the offset.

Don't take any of this as an endorsement of this "technique". It
isn't. I just said that it was not enough to keep me from buying
the book. It is not something I would ever do in my own code; I
try to stay out of the areas of undefined behavior.



-- 
Dave Eisen                               Sequoia Peripherals: (415) 967-5644
dkeisen@leland.Stanford.EDU              Home:                (415) 321-5154
       There's something in my library to offend everybody. 
          --- Washington Coalition Against Censorship
From: amerritt@dante.nmsu.edu (Angela Merritt)
Newsgroups: comp.lang.c
Subject: Need info on 'c' library for Tape backup software.
Date: 6 Jan 93 22:58:42 GMT
Organization: New Mexico State University, Las Cruces, NM

I'm looking for some information about 8mm tape backup software,
and I'm hoping someone can help!  I have an 8mm tape system on
my 486 pc using a scsi (adaptec) interface.  We are writing
some custom software on the PC and would like to incorporate
the tape backup functions into our code.  My Wish List would
ideally include software that provides the following
functions:

1.  A 'C' library of tape functions so I can operate the
    tape drive directly from my code.

2.  Some sort of standard user interface so the operator
    can do tape functions when not using the custom software.

3.  This is the catch.  The tape formats of the two functions
    above should be interchangable.

I already have some NovaStor software that does the above but
the tape format that results from the 'c' callable routines is
different from their standard canned program.  We really need
just one tape format to worry about!  Since I'm kind of new
to the world of tape backup systems I don't even know if
what I'm looking for is available.  If anyone has any information
about this I would appreciate hearing from you!

Much Thanks
Angie
(Email: amerritt@dante.nmsu.edu)
From: adams@pdv2.fmr.maschinenbau.th-darmstadt.de (Adams)
Newsgroups: comp.lang.c
Subject: Re: speed?  double vs. float.  math.h??
Date: 13 Jan 93 01:14:54
Organization: TH-Darmstadt
Distribution: world
NNTP-Posting-Host: pdv2.fmr.maschinenbau.th-darmstadt.de
In-reply-to: c60b-3hu@web-3c.berkeley.edu's message of 26 Dec 1992 09:17:53 GMT

In article <1hh801INNab1@agate.berkeley.edu> c60b-3hu@web-3c.berkeley.edu (Paul Hsu) writes:

>	I'm currently writing a C program where it needs to do lots and lots of
>   trig calculations.  But I would like the program to run really really fast.


Perhaps, find a better algorithm. For some problems requiring lots
of trigonometric calculation better algorithms are known
(FFT -> DFFT)

>   So I'm concerned about the speed at which the calculations are carried out.
>   Trying to make the program run fast, I would like to have only float 
>   variables, instead of doubles, in my program.  But in the standard math 
>   library, all the functions take in arguments and return values in the type 
>   double.  So, what should I do?  First of all, should I even be concerned 
>   about the speed difference between doing calculations in float and doing the
>   calculations in doubles?  If yes, how should I go about in making the math 
>   functions to accept and return floats?  Casting them won't help....  it'll 
>   only take more time in the type conversion.  Any suggestion?

As for most hardware (or micro code) implementations of floating point,
double or extended double are standard, calculations done
in float require additional [!] cycles to convert values to double
and results back to float ;-<.

I would be concerned about function call overhead. Therefore I would
prefer a compiler able to generate inline code accessing FP-hardware
in a direct manner insteadt via library call.
(GCC does this by special include files like math-68881.h, 
SUN's cc on SUN3 do it without support by special include files.)

best adams
From: cox@gda.cadence.com (Henry Cox)
Subject: Recommendations for C/C++ debuggers solicited
Followup-To: sender
Summary: the title says it all
Reply-To: cox@cadence.com
Organization: Cadence Design Systems. Lowell MA
Date: Thu, 7 Jan 1993 19:47:05 GMT


Cadence is in the process of evaluating debuggers for C and C++ code
as a prelude to a very large purchase shortly after the evaluation is
complete. 

We are aware of/looking into the following options:
	- "Energize" from Lucid
	- "ObjectCenter"/"CodeCenter" from Centerline
	- "ObjectWorks" from Parc Place
	- Cygnus (GNU)

If you are aware of any alternatives that we should look into or have
experience (good or bad) with a debugger[*], I would very much like to hear
from you.  

A short list of desirable characteristics:
	- one debugger for both C and C++ code.  We also have a lot of
	  SKILL (lisp-like) code - it would be nice to do something
	  about that as well.  Unlikely, however.
	- available on multiple platforms  Sun is our major
	  development platform.  We port to pretty much everything
	  else you can think of.
	- scales to very large programs - 15M(+) executables, 100K(+)
	  lines of code.  Performance is an issue - but not the only one.

If you are involved with such a product, shameless promotion is
encouraged.  (The product need not be commercially available at
present - we are probably willing to wait a bit for something really
good.) 


If at all possible, please mail responses to me (our newsfeed is both
very slow and somewhat unreliable).  I will summarize and post unless
you request otherwise. 

PLEASE NOTE:  My involvement in this is as one of the evaluators...I
speak for no one but myself, control no purse strings at Cadence, etc.

Thank you

					Henry

[*] I have had lots of (unhappy) experience with DBX, so you probably
don't need to send me your horror story unless you really want to...

--

Henry Cox		Cadence Design Systems - CAE Division, Lowell MA
cox@cadence.com		Ph. (508) 934-0410   Fax: (508) 452-6160
Newsgroups: comp.lang.c,comp.lang.c++,comp.lang.misc
From: 900752s@dragon.acadiau.ca (JODY SCHOFIELD)
Subject: Re: How to turn PC speaker off?
Organization: Acadia University
Date: Fri, 8 Jan 1993 14:05:08 GMT

 wieck@jwminhh.hanse.de (Jan Wieck) writes:
 : cschang@hamlet.umd.edu (C. S. Chang) writes:
 : : Is there any way to turn the PC speaker off so that there will be no
 : : beeps if a certain function call failed.  I do not have access to this
 : : particular function call which beeps at failure.  So I am looking for
 : : a way to prevent the PC from generating some beeping noise.
 : 
 : Oh, you wanted a solution for PC-DOS? Well, also possible, cut the
 : wire (this is no joke - it's the only way under PC-DOS).

	Why not buy a switch and mount it on your PC and wire the speaker
to it.  When you want noise flip the switch, if not turn the switch off. 8)

-- 
//-----------------------------------------------------------------------------
//	Jody Schofield (900752s@dragon.acadiau.ca)  Acadia University
//-----------------------------------------------------------------------------
From: paul@terminus.ericsson.se
Newsgroups: comp.lang.c
Subject: enum checking using C compiler
Date: 11 Jan 93 16:13:44 GMT
Reply-To: paul@terminus.ericsson.se
Distribution: world
Organization: Camtec Electronics (Ericsson), Leicester, England

Does anyone out there know where I can get hold of a prog that
will check for integers being assigned to enumerated data types.

eg

typedef enum {
	fred,
	joe,
	harry
} PEOPLE;

int i=2;
PEOPLE names;
names=i;       <----- Want it to find this

I've tried using gcc (even tried to mackle the progs so I could use
g++ -Wenum-clash

The only lint I have is non ansi.

Thanks in advance for any help

Paul Isaac
Ericsson-Camtec  Leicester
EMAIL:  paul@terminus.ericsson.se 


Newsgroups: comp.lang.c
From: dnl@convex.is.macsch.com (David Lombard)
Subject: Re: NH-- > NH
Organization: MacNeal-Schwendler Corp.
Date: Sat, 9 Jan 93 01:09:46 GMT

In article <1993Jan8.210335.28340@sharebase.com> keith@torme.sharebase.com (Keith Chambless) writes:
>In article <C0JMw6.680@netnews.jhuapl.edu> bandy@netnews.jhuapl.edu (Mike Bandy) writes:
>>
>>So what you're saying is that NH > NH.  I don't believe it.  Your 
>>compiler (or your logic) has some serious problems.
>
>
>Weird. Mine (Solbourne w/OS/MP 4.0) works the same:
>
>	if (nh-- > nh)
>	  printf("nh-- > nh = true\n");
>
>prints true. I don't understand.


First, the original author of "nh-- > nh" should be shot (unless of course
it's meant as a jest, a trick question, or an extract from some obfuscated
programming contest:-)

As far as why it _is_ working, the operation nh-- is executed _before_ the 
second reference to nh is used.  A way to look at the comparison (ingoring
the side effect) is:

	nh > (nh-1)

Never confuse "Gee it works" with "that's the result you should expect."

Regards,
DNL

                 MY_COMMENTS = MY_OPINIONS = NOBODY_ELSES;

David N. Lombard    The first thing we do,         The MacNeal-Schwendler Corp
dnl@macsch.com      Let's kill all the lawyers.    815 Colorado Blvd
(213) 259-4911      II Henry VI, IV.ii             Los Angeles, CA  90041
Newsgroups: comp.lang.c
From: rfries@sceng.ub.com (Robert Fries)
Subject: Re: Problem with Turbo-C: calculating with pointers
Organization: Ungermann Bass
Date: Thu, 7 Jan 1993 16:06:48 GMT

In article <1993Jan7.112219.578@reks.uia.ac.be> derijkp@reks.uia.ac.be (Peter De Rijk) writes:

>I am porting a program (working on different platforms such as VAX and DEC) to
>the PC. I am using Turbo C++ v.3.0. I compile using the huge memory model.
>I seem to have tracked down the problem (well, one of the problems.) I don't
>know what to do about it though. Here's a little program to illustrate the
>problem:

>#include <alloc.h>

>main()
>{
>char *pointer,*begin,*end;
>long size;

>size=71800;
>pointer=(char *)farmalloc(size*sizeof(char));
>begin=pointer;
>end=pointer+size;
>printf("%p %p %ld",begin, end, end - begin);
>}

>I would expect end - begin to return 71800. However it seems to return 6264.
>This is exactly 64K less.
>If this happens for all pointer calculations, I'm in big trouble.
>Any ideas to solve this.

>All help is greatly appreciated.

>Peter

You need to declare the pointers as huge pointers:

char huge *pointer, huge *begin, huge *end;

Robert

//////////////////////////////////////////////////////////////////////////
Robert Fries
Ungermann-Bass Inc.

DISCLAIMER:
    Opinions contained herein are my own, and are not necessarily those
    of Ungermann-Bass.
//////////////////////////////////////////////////////////////////////////
Newsgroups: comp.lang.c
From: news@massey.ac.nz (USENET News System)
Subject: Re: struct vs. typedef
Organization: Massey University
X-Useragent: Nuntius v1.1
     <1993Jan11.170937.22822@informix.com>
Date: Wed, 13 Jan 93 02:07:38 GMT

In article <uRL4wB7w165w@cybrspc.uucp> Roy M. Silvernail,
roy%cybrspc@cs.umn.edu writes:
>Nevertheless, I ended up with
>
>typedef struct n {
>    int x,y;
>    struct n *last,*next, *up, *down;
>    void (*show)(struct n *);
>    int width;
>    void **value;
>} ITEM;
>
I prefer,

#define ITEM struct n

typedef ITEM {
   int x,y;
   ITEM *last,*next,*up,*down;
   void (*show)(ITEM *);
   int width;
   void **value;
};

Just my $0.02 worth.

Rob.
Xref: sparky comp.lang.c:19299 rec.humor:37451
From: Steve.Lake@brunel.ac.uk (Steve M Lake)
Newsgroups: comp.lang.c,rec.humor
Subject: Re: Program to convert .EXE to a "C" source file?  I really need one!!
Date: 6 Jan 93 09:42:39 GMT
Organization: Brunel University, West London, UK

OK, so I know that de-compilers exist, but de-compiling to C source ??????
I thought that they could only de-compile to Assembler.

Anyway, who would WANT a copy of WordPerfect 2.whatever in C source, I have
enough trouble understanding my own C code, but code written by a decompiler
would be even worse. Still, having said all of that, If it does exist 
(The C Decompiler, not WordPerfect 2) can someone tell me where

And if all of this is one big joke, well, I guess i've been fished in.
Newsgroups: comp.lang.c
From: raph@panache.demon.co.uk (Raphael mankin)
Subject: Re: Pattern Matching for Spelling Correction 
Distribution: world
Organization: Solvfield Ltd.
Reply-To: raph@panache.demon.co.uk
X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.19)
Date: Fri, 8 Jan 1993 20:22:37 +0000

In article <1993Jan7.054651.25174@spartan.ac.BrockU.CA> tmc@spartan.ac.BrockU.CA writes:

>I'm currently working on the front-end to an information retrieval
>package and would like to incorporate a facility to provide for
>spelling correction. Does anyone have any recommendations for an
>efficient pattern matching algorithm which could be used in this
>capacity? 
>
>The dictionary is rather large (but static) and I would prefer having
>the option to search the entries either on disk or through a table
>in memory. 
>
Sorry to be so short tempered, but does no-one ever read the journals?

CommACM Oct 1992 Vol 35 No 10. pp74-91
and a whole host of others. Try your university library.

-- 
--------------
Raphael Mankin			Nil taurus excretum
Newsgroups: comp.lang.c
From: ted@ocsmd.ocs.com (Ted Scott)
Subject: Pointer math (was Re: adding strings together)
Organization: Online Computer Systems, Inc.
X-Newsreader: Tin 1.1 PL5
Date: Tue, 5 Jan 1993 16:38:14 GMT

Benjamin Ketcham (bketcham@stein.u.washington.edu) wrote:
: It's illegal to perform addition on pointers. 

'Tisit?  consider:

char *end;
char buffer_stuff[128];

for(end = buffer_stuff + 128;(end > buffer_stuff && *end == ' ');end--) 
         ;  /* null loop body */                     ^^^^^^^^^^
                                         better to use some index func. here

Looks like addition and subtraction to me :-0

: That's one of the things I like about C.  It doesn't let you "just"
: add two strings together, without realizing what you are doing.

I contend that C will let you do alot without realizing what you're
doing. You can add two string pointers together, just don't expect the 
result to be a concatenated string.

--

-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: dkeisen@leland.Stanford.EDU (Dave Eisen)
Subject: Re: A question about memory
Organization: Sequoia Peripherals, Inc.
Date: Mon, 4 Jan 93 21:55:07 GMT

In article <1993Jan4.210804.326@spartan.ac.BrockU.CA> brad@spartan.ac.BrockU.CA (Brad Saxton) writes:
>
>Lets say you call an operating system function (say getpwuid) that 
>returns a pointer to a structure. At some point, the information 
>returned will no longer be needed, so we would like to return the memory 
>to the available pool. My question is HOW?

There are three ways a function can return a pointer to a
block of memory.

(1) You pass in this pointer (or a related pointer) as a parameter
    to the function. strcpy uses this mechanism.

(2) The function calls malloc or one of its relatives and returns
    a pointer to the space allocated. strdup uses this mechanism.

(3) The function returns a pointer to a statically allocated buffer.
    This is the mechanism that getpwuid uses.

Each method has its advantages and disadvantages: (1) is the most
reliable and easy to implement, but then the code that calls the
library function has to worry about passing in a buffer that is
big enough; (2) is fine except the onus is then on the user of
the function to free the memory when it is no longer being used;
and (3) is great except for the fact that successive calls to
the function use the same block of memory so if a user wants to
access the data later in the program, he has to save it off.

Each of the mechanisms require different steps be taken by the
programmer using the library function. For this reason, the
manual page that describes the function must include information
about which mechanism is being used.

In your case, with getpwuid, the function returns a pointer to
a static buffer. It is illegal to call free with this pointer
as its argument since this pointer was not obtained from malloc
or its cousins. It uses a static buffer that cannot be deallocated
in any way. But don't worry about it --- the buffer is not big
enough to cause any problems in your program. 

-- 
Dave Eisen                               Sequoia Peripherals: (415) 967-5644
dkeisen@leland.Stanford.EDU              Home:                (415) 321-5154
       There's something in my library to offend everybody. 
          --- Washington Coalition Against Censorship
Newsgroups: comp.lang.c
From: Ron Wichers Schreur <ronny@cs.kun.nl>
Subject: C palindrome puzzle: a solution
Organization: University of Nijmegen
X-Useragent: Nuntius v1.1
Date: Tue, 5 Jan 1993 13:26:38 GMT


Hello,

Some time ago, I challenged you to write a C palindrome
that prints "hello world", without using comments. A few
solutions were given, but they ignored new-line characters.

Perhaps you are interested in the palindrome I found. To
save band width, I'll only post the second half of
my program:

    ab(( b enifed#
    cd enifed#
    cb bc enifed#
    ;dc int enifed#
    diov main enifed#
    niam tni void enifed#
    };0 nruter;dc"dlrow olleh"cb stup{
    ) dc enifed#
    )diov cb niam tni
    ab( cb enifed#
    >h.oidts<edulcni#
    ab enifed#
    )ab(ba enifed#
    ;)diov(niam tni

It must be possible to find a shorter version. If
you do, I'd be interested in your solution.


Cheers,

Ronny Wichers Schreur
ronny@cs.kun.nl
From: cosc18op@menudo.uh.edu ( Stephen)
Newsgroups: comp.lang.c
Subject: FOR SALE: Turbo C/C++ compiler
Date: 12 Jan 1993 16:39:57 -0600
Organization: University of Houston
NNTP-Posting-Host: menudo.uh.edu

I have a Borland Turbo C/C++ compiler for ms-dos that I want to sell.
Media is 3.5" disks. Asking price is $60 (shipping included). However, I
am willing to negotiate. Package is in good condition and includes original
box with all documentation but no registration card. If you are
interested, I can be reached at :  cosc18op@menudo.uh.edu

Steve 

Newsgroups: comp.lang.c
From: jepler@nyx.cs.du.edu (Jeff Epler)
Subject: Sparse 4+dimentional array?
Organization: Nyx, Public Access Unix @ U. of Denver Math/CS dept.
Date: Thu, 7 Jan 93 01:26:16 GMT

I recently created a program that creates "words" based on letter
probabilities found in text files fed to it.  It uses a table which
relates the last two letters in the word to the probability of the next
letter. (IE maybe "o" follows "zo" 95% of the time, but "n" does 5%).
I now have the desire to allow the program to use a table of more than
the past two letters.

However, my compiler (No, this is *not* an implementation specific query,
really) and OS restrict me to 640K, with no array bigger than 64K (Can you
guess what OS this is? You're right.)  -- This means that declaring such 
a large array as 
 int table[27][27][27][28] 
is *not* an option.. (this is some 500K), and more levels are also "out
of the question."  However, many letter combinations will never be used
 -- ZZZ? or QAA? or QWE? -- So I concieved of the idea of using a sparse
array.

So, since I have seen (Though more often in comp.lang.pascal) posts
which detail how to create and manipulate sparse matricies, I hope
someone here can help me.. (All of the posts, which are probably
expired, have only spoken about two-dimensional sparse matricies, though.)

Code would be nice, (Some sparse-matrix C program even) but ideas or 
algorithm pointers would do fine.. Thanks.. (Feel free to mail or
post -- I try to keep up in here..)

--
Jeff Epler jepler@nyx.cs.du.edu or bx304@cleveland.freenet.edu (preferred)

Signature under construction
Newsgroups: comp.lang.c
From: leisner@wrc.xerox.com ( Marty Leisner)
Subject: Re: Code Analysis Tools Info Request
Reply-To: leisner@eso.mc.xerox.com
Organization: Xerox
X-Newsreader: TIN [version 1.1 PL8]
Date: Sat, 9 Jan 1993 21:12:27 GMT

David Quinn-Jacobs (jacobs@erc.cat.syr.edu) wrote:
: I am looking for code analyis tools (other than cflow and cxref) which
: perform the following functions:

:     o    Cyclomatic Complexity Analysis (McCabe)
:     o    Calling Trees (graphic or textual)
:     o    Cross Referencing (particularly noting global variable usage)

: It does not matter if the tools are commercial or in the public domain.  (If 
: they apply to Fortran as well as C, that is a plus.)

: Please post replies to the following email address since I cannot access
: news very often.  Thanks in advance.
: ----------------------------------------------------------------------------
: Dave Quinn-Jacobs                           Phone: (315) 724-1100
: The Analytical Sciences Corp. (TASC)          FAX: (315) 724-3330
: 555 French Rd.                              Email: jacobs@erc.cat.syr.edu
: New Hartford, NY 13413
: -- 
: ------------------------------------------------------------------------------
:    			       David Quinn-Jacobs

: 		  *          Plainfield Associates

Look at Brian Renaud's metrics package and mkid (in comp.source.{unix or misc}.

They're excellent.

Also get cdecl. 

Also it is bad etiquette to ask for email requests to posted subjects, because you don't have time
to read news.

Why does anyone else?

--
marty
leisner.henr801c@xerox.com  leisner@eso.mc.xerox.com
Member of the League for Programming Freedom
Newsgroups: comp.lang.c,rec.humor
From: nelson@desktop.nsc.com (Taed Nelson)
Subject: Re: Program to convert .EXE to a "C" source file?  I really need one!!
Organization: Applications Technology, National Semiconductor (Santa Clara, CA)
Date: Tue, 5 Jan 1993 02:23:05 GMT

[The original poster wanted something to convert EXE's to C source.
  Subsequent postings have made fun of that person.]

What the original poster was probably thinking of was the recently-posted
  program that converted EXE's and COM's to assembly code.

BUT, it is not unreasonable to be looking for a tool to convert an EXE to C
  code.  Of course, it is near-impossible to convert it to the ORIGINAL C code
  (orignal variable names and whatnot are in the symbol table, of course), but
  not all that hard (compared to other daunting tasks) to convert it into
  EQUIVALENT C code.  Of course, optimization would make the task even more
  difficult due to some implied side effects.

Tools of this sort were used to do the first analyses of the InterNet Worm,
  both at Purdue and Berkeley, if I remember correctly.  The first Purdue
  paper, I believe, had a considerable discussion of this process.

Whether such tools exist for DOS compilers, and just how automated any of the
  decompilers are, I don't know...

Newsgroups: comp.lang.c
From: acgoldis@athena.mit.edu (Andrew C Goldish)
Subject: Executing DOS commands from program
Organization: Massachusetts Institute of Technology
Date: Mon, 11 Jan 1993 21:47:06 GMT

  I am writing a Microsoft C program to be run on computer A which is supposed to
get a command from the user (no problem) and execute it ON COMPUTER B, with any
errors and results from computer B's calculation sent back to computer A.  How
exactly do I do this?  Borland C (or at least Pascal) has an EXEC function, but
I can't use that here.  The command is stored as char comnd[255] or so.

							A. Goldish