HDTenEightyP/NetNews huggingface dataset:
From: apo@datmuc.UUCP (Karsten Seidel)
Newsgroups: comp.lang.c
Subject: Re: About the 'F' in RTFM
Date: 21 Jul 92 07:16:34 GMT

In <1992Jul20.144048.15503@ugle.unit.no> robert@solan.unit.no (Robert Schmidt) writes:

>In article <3122@dozo.and.nl>, jos@and.nl (Jos Horsmeier) writes:
> > In article <1992Jul17.202448.19848@wyvern.twuug.com> alpha@wyvern.twuug.com (Joe Wright) writes:
> > |Proposed change to 'standard' practice.  'RTFM' is now 'RTM'.
> > |The 'F' does not relate to any known adjective for Manual.
> > |'Read The Manual' should suffice.
> > 
> > fabulous? famous? fancy? fantastic? fascinating? fateful? favourable?
> > fine? forgiving? forgotten? formidable? funky? funny? ;-)
>
>fucking?

At last !!!

> 
> > Jos aka jos@and.nl
>
>Hope I get lotsa flames for this one!! :)

NOT from _me_.
EVERYBODY knows about the meaning of the 'F' in RTMF - _SO_ _WHAT_ !!!
The only thing I was wondering about this strange guy: Was he serious with his
suggestion, was he trying to be funny (he failed, at least in the way he wanted
to be) or did he want to "start a new thread"?
Or is there another possibility I forgot ... :-) ?
cu
	apo

#################################################
# Der Hasenfuss zittert vor einer Gefahr,       #
# der Feigling waehrend und der Mutige hernach. #
#################################################
-- 
#################################################
# Der Hasenfuss zittert vor einer Gefahr,       #
# der Feigling waehrend und der Mutige hernach. #
#################################################
-- 
#################################################
# Der Hasenfuss zittert vor einer Gefahr,       #
# der Feigling waehrend und der Mutige hernach. #
#################################################
Newsgroups: comp.lang.c
From: kps@cunixb.cc.columbia.edu (Karthik P Sheka)
Subject: linking gcc code with CC code
Keywords: link
Reply-To: kps@cunixb.cc.columbia.edu (Karthik P Sheka)
Organization: Columbia University
Date: Thu, 30 Jul 1992 18:20:47 GMT


Is it possible to link gcc created object files with CC created object
files?  I've tried doing so but it seems that the c functions cannot call
the c++ functions, even though the c++ functions are not in any class.
Sample code follows... (The error returned is Undefined symbol: routine2)

/*****C++ code*****/
#include <iostream.h>
extern "C"{
int routine1(void);
};

int main(void)
{
  cout << routine1();
}
static int routine2(void)
{
  return 2;
}


/*****C code*****/
extern int routine2();

int routine1(void)
{
  return(routine2());
}
Newsgroups: comp.lang.c
From: mat@uunet.uu.net!mole-end
Subject: Re: About the 'F' in RTFM
Summary: Friable, actually
Organization: :
Date: Thu, 23 Jul 1992 17:31:23 GMT

In article <1992Jul22.203604.24253@mole-end>, mat@mole-end writes:
> In article <1992Jul18.163941.24358@dartvax.dartmouth.edu>, mozart@coos.dartmouth.edu (Sting) writes:
> > In <1992Jul17.202448.19848@wyvern.twuug.com> Joe Wright writes:
 
> Of course, since the fusty manuals are often neglected until they are
> about to crumble into dust, it could also mean
> 
> 	Read The Fungible Manual

Chris Torek was good enough to point out to me that I had typed faster
even than I thought; of course I meant `friable.'
-- 
 (This man's opinions are his own.)
 From mole-end				Mark Terribile

 uunet!mole-end!mat, Somewhere in Matawan, NJ
Newsgroups: comp.lang.c
From: mat@mole-end
Subject: Re: About the 'F' in RTFM
Summary: Or Fusty
Organization: :
Date: Wed, 22 Jul 1992 20:33:49 GMT

In article <3122@dozo.and.nl>, jos@and.nl (Jos Horsmeier) writes:
> In article <1992Jul17.202448.19848@wyvern.twuug.com> alpha@wyvern.twuug.com (Joe Wright) writes:
> |Proposed change to 'standard' practice.  'RTFM' is now 'RTM'.
> |The 'F' does not relate to any known adjective for Manual.
> |'Read The Manual' should suffice.
> 
> fabulous? famous? fancy? fantastic? fascinating? fateful? favourable?
> fine? forgiving? forgotten? formidable? funky? funny? ;-)

I also sometimes find that it is a `Fusty Manual,' given how often it
is doesn't match the current version of the software.
-- 
 (This man's opinions are his own.)
 From mole-end				Mark Terribile

 uunet!mole-end!mat, Somewhere in Matawan, NJ
From: dave@cs.arizona.edu (Dave Schaumann)
Newsgroups: comp.lang.c
Subject: Re: fast circle
Date: 30 Jul 92 15:26:02 GMT
Reply-To: dave@cs.arizona.edu (Dave Schaumann)
Distribution: usa
Organization: University of Arizona

In article <29JUL199223461993@venus.tamu.edu>, jle9162@venus (ECKHARDT, JASON LEE) writes:
>  I'm looking for a FAST circle algorithm...'C' code or pseudocode, it
>doesn't matter, as long as it cooks.

Assuming that you're talking about an algorithm that will draw a
circle on a bit-mapped display, check out chapter 3 of _Computer
Graphics: Principles and Practice_ by Foley, et. al.  It has a very
nice algorithm that uses integers and no multiplies.

-- 
What signature?
From: mdr@ocf.berkeley.edu (Mike Rogoff)
Newsgroups: comp.lang.c
Subject: Array question....
Date: 22 Jul 1992 23:51:26 GMT
Organization: U.C. Berkeley Open Computing Facility
Distribution: ca
NNTP-Posting-Host: tempest.berkeley.edu
Keywords: help?

Forgive my naivity, but could somebody help me with dynamically
allocating arrays?  How would you go about it?  If you just 
malloc a bunch of space, can you reference it with array [] subscripts
and have it work?

thanks.....

mike

Newsgroups: comp.lang.c
From: torek@horse.ee.lbl.gov (Chris Torek)
Newsgroups: comp.lang.c
Subject: Re: semantics of "<=" change in ANSI C?
Date: 26 Jul 1992 01:17:54 GMT
Organization: Lawrence Berkeley Laboratory, Berkeley
Reply-To: torek@horse.ee.lbl.gov (Chris Torek)
NNTP-Posting-Host: 128.3.112.15

In article <1992Jul20.155649.7791@chinet.chi.il.us>
les@chinet.chi.il.us (Leslie Mikesell) writes:
>... maybe I just have a broken compiler since it seems to handle constant
>initializers differently than the same values at runtime.
>
>For example:
>#include termio.h
>main()
>{
>unsigned short a = ~CBAUD;
>....
>}
>gives me an error "initializer does not fit: -16" unless I add a
>cast, but moving the assignment to runtime does what I expected
>even without a cast.  Is that normal?

If the error is merely a warning, the compiler may still conform to
the ANSI C standard.  If it stops compilation, the compiler is broken.
Assignment to an unsigned causes truncation modulo some power of two,
the exact power depending on the maximum value for variables of that
unsigned type, so even

	unsigned short a = -16;

is legal, setting a to 65520 on typical current machines.

In this particular case, a warning is probably a disservice, although
there may be counterexamples.  (For instance, under the BSD
implementation of POSIX termios, the c_cflag field has type `unsigned
long'.  On the other hand, the BSD implementation has no CBAUD: tty
baud rates are just integers, as they should always have been.)
-- 
In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 510 486 5427)
Berkeley, CA		Domain:	torek@ee.lbl.gov
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.lang.c
Subject: Re: Strange dicrepancy between  DECstation & Sun 4
Date: 23 Jul 92 19:28:43 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
NNTP-Posting-Host: telecaster.think.com

In article <BruoII.21n@cs.dal.ca> vanadis@cs.dal.ca (Jose Castejon-Amenedo) writes:
[Extracting the relevant part of his program:]
>main (int argc, char ** argv)
>{
>/* argv points to an array of strings. */
>
>  char * strs[] = { "points", "Herewith", "shall", "we", "show",
>                    "our", "third", "test" } ;
...
>  printf ("%c\t", ++**argv);   /* Pointer unchanged.
>                                  Replaces 1st character 3rd string by
>                                  next character in character table,
>                                  and then returns that. */

On the Sun this gets a segmentation fault, while it works on A Decstation.

This is a bug in your code.  On many systems, literal strings are stored in
the read-only text section of the program.  Attempting to modify them can
have unpredictable effects.  Even if it doesn't cause an immediate trap, it
may have strange effects on your program behavior; for instance, if there
are two identical literals, the compiler might create a single constant and
use a pointer to it for both, e.g. after declaring

char *foo = "Test";
char *bar = "Test";

it would be possible for (foo == bar) to be true, and the following might
print "Best":

	*foo = 'B';
	printf ("%s", bar);

With GCC, you can tell it not to put strings in read-only storage by using
the -fwritable-strings option.

P.S. It would be nice if you'd reduce example programs to the minimum that
exhibits your problem.  Following all those extraneous ++'s, and the
totally irrelevant references to argv, was difficult when I was trying to
figure out exactly which line was having the problem.  Luckily you
commented it well.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
Newsgroups: comp.lang.c
From: mat@mole-end
Subject: Re: About the 'F' in RTFM
Summary: It's Florblondjet!
Organization: :
Date: Wed, 22 Jul 1992 20:31:52 GMT

In article <1992Jul17.222246.29743@hplabsz.hpl.hp.com>, chew@hplb.hpl.hp.com (Chee Chew) writes:
> In article <1992Jul17.202448.19848@wyvern.twuug.com>,
> alpha@wyvern.twuug.com (Joe Wright) writes:
> |>Proposed change to 'standard' practice.  'RTFM' is now 'RTM'.
> |>The 'F' does not relate to any known adjective for Manual.
> |>'Read The Manual' should suffice.
> |>
> |>-- 
> |>Joe Wright  alpha@wyvern.twuug.com    
>       
> what?  you got something  against the word "friendly" ?

In my experience, it's more likely `The Florblondjet Manual' (pronounce
as `flublungit.')
-- 
 (This man's opinions are his own.)
 From mole-end				Mark Terribile

 uunet!mole-end!mat, Somewhere in Matawan, NJ
Newsgroups: comp.lang.c
From: mjs@hubcap.clemson.edu (M. J. Saltzman)
Subject: Pointers to freed memory
Organization: Clemson University, Clemson SC
Date: Wed, 29 Jul 1992 20:58:34 GMT

I know that a pointer to freed memory should never be dereferenced, 
but is it standard-conforming to assign or do arithmetic with such
pointers?

The application is a routine to free the elements of a circular list.
Since I have a count of the elements, I can simply run a pair of pointers
around the list, like so:

	for ( p = head, i = 0;  i < n;  i++ ) {
		q = p;
		p = p->next;
		free(q);
	}

The question comes up because on the last iteration, p->next points
to the element freed in the first iteration.  Do I need to break the
circle before I start the loop? Or am I just being paranoid after the 
discussion of pointers to invalid array elements?

Thanks.

-- 
		Matthew Saltzman
		Clemson University Math Sciences
		mjs@clemson.edu
Newsgroups: comp.lang.c
From: pjh@mccc.edu (Pete Holsberg)
Subject: Re: semantics of "<=" change in ANSI C?
Organization: The College On The Other Side Of Route One
Date: Wed, 29 Jul 1992 02:35:10 GMT

Was the question "What does the error message on the Subject: line
mean?" ever answered? If so, would some kind person mail it or post it?

Thanks.
From: ptran@envmsa.eas.asu.edu (Phi-Long Tran)
Newsgroups: comp.lang.c
Subject: Re: HELP
Date: 31 Jul 92 04:37:00 GMT
Organization: Arizona State University, Tempe, AZ
News-Software: VAX/VMS VNEWS 1.4-b1

In article <rfries.82@fries_Robert@ub.ub.com>, 
rfries@fries_Robert@ub.ub.com (Robert Fries) writes...
>In article <1992Jul30.154323.12491@cc.umontreal.ca> 
mikhail@ERE.UMontreal.CA (Mikhail Ossama) writes:

>>#include <stdio.h>
>>#include <stdlib.h>
> 
>>main(int argc, char *argv[])
>>{
>>if (argc!=4)
>> { 
>>  printf( " Usage : ./link prog.f -o prog.exe \n ");
>>  exit(0); 
>> }
>>system(f77 argv[1] -o argv[3] -L/usagers/garcia/gqopt/lib -lgq5 -lthomas -p);
>>}
> 
>Bonjour !
> 
>Try
>system
>("f77 argv[1] -o argv[3] -L/usagers/garcia/ggopt/lib -lgq5 -lthomas - p");
> ^                                                                     ^

     Sorry, no French.  The closest I would try is German ... but that's
not EVEN close.  There are two errors:

1) The function "system" requires a string (solved in the reply by Mr.
Ossama.

2) You need to format the string to contain the two arguments passed to the
program in argv[1] and argv[3].

     Try the following:

#define MAX_CMDLEN 255 /* Maximum length of command to pass to system. */

main(int argc, char *argv[])
{
   char command_string[MAX_CMDLEN];

   if (argc != 4)
   {
      /* Same as in original code. */
   }

   sprintf( command_string, 
      "f77 %s -o %s -L/usagers/garcia/ggopt/lib -lgq5 -lthomas - p", 
      argv[1], argv[3]);

   if (system( command_string ) != 0) /* Check to see if command failed. */
   {
      /* Report the error. */
      exit( EXIT_FAILURE );
   }
   else
      exit( EXIT_SUCCESS );
}

     You can check your local reference manuals about the exit() call and
the defines EXIT_FAILURE and EXIT_SUCCESS.

     If all you want is to spare yourself the trouble of specifying default
arguments to f77, there are several ways.  You may want to look into using
a makefile to automate compiling and linking.  If you still want to retain
the flexibility of the above program, you can use the following UNIX shell
script (I assume you're using UNIX from your original call to system):

--- Beginning of Script ---
#!/bin/sh
#
# Execute f77 with usual librariess and options.  User only specifies
# source file and name of resulting executable.  No need for "-o", although
# we can add statements to handle that.
#

if [ $# -lt 2 ]
   then
   echo "Usage: $0 source_file executable_file"
   exit 1
fi

libs="-L/usagers/garcia/ggopt/lib -lgq5 -lthomas"

f77 $1 -o $2 ${libs} - p
--- End of Script ---

---
Phi-Long Tran
ptran@asuvax.eas.asu.edu
Arizona State University
Newsgroups: comp.lang.c
From: Josef Moellers <mollers.pad@sni.de>
Subject: Re: Variable length records
Date: Thu, 30 Jul 1992 07:27:43 GMT
Organization: Siemens Nixdorf Info.Sys. AG, Paderborn, Germany

In <rbjmzg-.gurgle@netcom.com> gurgle@netcom.com (Pete Gontier) writes:

>adam@castle.ed.ac.uk (Adam Hamilton) writes:

>>	During my last spell at teaching C, I was asked what support C
>>could give for variable length records.  (Not variant records which I can
>>do with a union).  I was unable to answer the question, so promised to
>>seek help (this means you).

>Funny you ask; I just did some cursory research on this very topic. I had
>written some Mac code using declarations thus:

>typedef struct
>{
>	short   count;
>   float   data[ ];
>}
>foo;

>I refer to the second member as an "open array." Its behavior is this:
>	o  it may appear only as the last member of a structure
>	o  it does not contribute to the value returned by sizeof(foo)
>   o  it may be addressed, of course, with an arbitrary index

>I got worried about its portability so I paged through some manuals.
>Both major C compilers for the Mac support it. Turbo C and Microsoft
>C for the PC support it. According to Harbison and Steele, ANSI does
>*not* support it. And from experience I know that AT&T cfront 2.1 (the
>most common "standard" for C++) does not support it. I'm a little bit
>suprised that it's not in the ANSI standard, but after my research I
>felt it was common enough that I'd use it with impunity. And now I've
>just checked with 'gcc' 1.39, and it doesn't like it. Perhaps 2.x does.

You COULD just declare it as "data[1]", which will keep EVERY compiler
happy! Only now the burden is upon YOU to take this one float into
consideration when allocating/reading the data structure.

>>P.S.  I already know that Unix will have a problem with variable length
>>records since it doesn't know about records.  Nevertheless, if anyone knows
>>of an attempt to solve this I will be grateful to hear about it.

>Not knowing about records simply means you have to implement it yourself.
>There are no problems, as long as your compiler cooperates, with UNIX.
>-- 
> Pete Gontier // EC Technology // gurgle@netcom.com
-- 
| Josef Moellers		| c/o Siemens Nixdorf Informationssysteme AG  |
|  USA: mollers.pad@sni-usa.com	| Abt. STO-XS 113	   | Riemekestrasse   |
| !USA: mollers.pad@sni.de	| Phone: (+49) 5251 835124 | D-4790 Paderborn |
From: jos@and.nl (Jos Horsmeier)
Newsgroups: comp.lang.c
Subject: Re: Checking variables for characters & Copying portions of strings
Date: 29 Jul 92 08:09:23 GMT
Organization: AND Software BV Rotterdam

In article <1992Jul27.150815.2651@vpnet.chi.il.us> mox@vpnet.chi.il.us (William Moxley) writes:
|
| 
|Sorry if this question seems to be a bit basic, I'm new at this...
| 
|I'm adding an editing feature to a little database I wrote.  I need
|to be able to see if a certain variable has anything but whitespace
|in it.  (So that you can just hit enter past some of the fields
|instead of having to retype everything)  How can I do this?  I've
|tried strlen and sizeof, but they just tell me how big the string
|is defined for.
 
There's a function (or sometimes it's implemented as a macro,) called
`isspace()'. It'll return non zero when its argument (a single character)
is a space character, i.e. a white space, a horizontal tab, or a 
new line. You could use this function something like this:

if (s) {				/* test if string exists */
	for (; *s; s++)			/* check entire string */
		if (!isspace(*s))
			return 0;	/* non-space found */
	return 1;			/* string passed the test */
}
return -1;				/* not a string */

|Also, an unrelated question.  How can you copy a portion of a string
|into another?  What I want to do is to take a part out of the middle
|section of string 1, and put it in the middle section of string 2.
|I've looked at strncpy, but I don't know if/how it's possible to
|make it start from the middle of a string.

Being the lazy person I am, a first implemenetation woul look something
like this:

/*
 * Insert string t in string s at position p.
 * Leave the result in a buffer b.
 * Note that I've left out all sorts of exception checking ...
 */
char *strins(char *b, char *s, char *t, int p) {

	sprintf(b, "%-*.*s%s%s", p, p, s, t, s+p);

	return b;
}

I know that people might object against such practice, arguing that
sprintf is a huge function and very expensive to include just for
this purpose. But (IMHO) I think that most substantial programs use
sprintf or one of its friends somewhere in the code already, so this
implementation doesn't cause much overhead. It might be a bit slow tho ...

kind regards,

Jos aka jos@and.nl
From: dagahi@bhaskara.ucsd.edu (Daryush Agahi)
Newsgroups: comp.lang.c
Subject: ANSI-C compiler for IBM-pc
Keywords: ANSI-C for pc
Date: 22 Jul 92 23:37:33 GMT
Reply-To: dagahi@bhaskara.ucsd.edu (Daryush Agahi)
Organization: U.C. San Diego, AMES Department

Hi,

I am trying to get a copy  of  ANSI -C  for IBM pc clone.  Is there
one in public domain ? 

I would appreciate any help/suggestions in obtaining a copy (not
purchasing one!).

Thank you in advance.

Daryush
From: mark@e7sa.epi.syr.ge.com (Mark Duening   X2030)
Newsgroups: comp.lang.c
Subject: WANTED:  Compiler for 680x, Z80, 8088...
Date: 28 Jul 92 11:50:57 GMT
Reply-To: mark@e7sa.epi.syr.ge.com
Organization: GE Corporate R&D Center

I am in the process of putting together a small electronics device
which will be controlled by some sort of microprocessor.  To keep costs
down, I will be using a lower end processor like the MC6800 (no, not
68000), Z80, 8088, etc.  The determining factor will be what kind of
compiler/assembler I can get to support the development.  Compilers
would preferably be C compilers.

Any and all info will be appreciated.

Mark

e-mail responses to:  mark@e7sa.epi.syr.ge.com
From: aabdalla@pollux.usc.edu (Ahmed Abd-Allah)
Newsgroups: comp.lang.c
Subject: 'extern' storage type...
Date: 29 Jul 1992 12:29:29 -0700
Organization: University of Southern California, Los Angeles, CA
NNTP-Posting-Host: pollux.usc.edu

I'll explain this as briefly as possible, your help is gratefully
appreciated in advance.

Recently a customer who just bought one of our products started to
complain that the software that came with it was locking up his 
computer (IBM compatible).  We use Borland's Turbo C compilers.
Well, I went over the code, and it all seemed ok and bug free when
I found the following POSSIBLE error.  In one of the source files
I have an array of structure-types defined, like so:

	struct coordinates r[25];

However, in another source file, I found the following typo I made and
didn't catch the first time around:

	extern struct coordinates r[5];

Notice that the array is defined as having 25 spaces, but in the second
source file I missed putting in the '2'.

Now, ny question is, does this typo mess things up, or since there are
25 spaces allocated anyway, everythings fine?  No I cant just try it and 
send it because the customer has apparently asked about this twice now,
so I need to know BEFORE I send it to him (and he has some specialized
hardware at his site).

The last thing is that I tried generating the assembly files for the 
second source file if I tried r[], r[5], and r[25].  Here's what I found:

If I put r[25] --> The code is the same as the other two ways BUT there
is around 10 or so branches/jumps which use labels starting from 11 to 21.

If I put r[] --> The code is the same as the other two ways BUT the branch
labels go from 25 to 35.

If I put r[5] --> The particular branches go from 0 to 10.

From what I know of C, r[] and r[25] should work, but I'm asking if r[5] will
bug things up (cause memory to be overwritten somewhere and thereby cause
a random computer lock up?).

PLEASE SEND EMAIL IF YOU DO REPLY >> aabdalla@pollux.usc.edu

Thanks a lot (sorry for the length...).

Ahmed A. Abd-Allah

PS:
What's in the structure is irrelevant I think, but here it is anyway:
struct coordinates
{
	int y, x;
}


Newsgroups: comp.lang.c
From: jutta@opal.cs.tu-berlin.de (Jutta Degener)
Subject: Re: Variable arguments & macros...
Keywords: macros, varargs
Organization: Techn. University of Berlin, Germany
Date: Wed, 22 Jul 1992 15:54:29 GMT

markkj@mullian.ee.mu.OZ.AU (Mark Johnston) writes:
>    I'm wondering if anyone has any really devious ways of writing macros
> so that variable arguments can be used.  [..] I have a function
>
> int writeErrorMsg(int quit, char *file, int line, char *format, ...)
[..]
> #define error(x) writeErrorMsg(0, __FILE__, __LINE__, x)
> #define fatal(x) writeErrorMsg(1, __FILE__, __LINE__, x)
[...]
> error("The error code is %1d.", errCode);

I did something like that once, although the details are rather messy.
In your error handling module, have three variables and two functions:

	#include <stdarg.h>
	#include <stdio.h>

	static char * file;
	static int    line, level;

	static void writeError(char * fmt, ...) {	/* from C FAQ part 6 */
		va_list ap;
		fprintf(stderr, "file \"%s\", line %d: ", file, line);
		va_start(ap, fmt);
		vfprintf(stderr, fmt, ap );
		va_end(ap);
		fprintf(stderr, "\n");
		if (level == 1) abort();
	}

	void (* locateError(int v, int l, char * f))(char *, ...) {
		level = v; file = f; line = l;
		return writeError;
	}

Then declare and #define in a header file:

	extern void (* locateError(int, int, char *))(char *, ...);

	#define error	(locateError(0, __LINE__, __FILE__))
	#define fatal	(locateError(1, __LINE__, __FILE__))

And use:

	error("switch failed (event.type==%lx)", (long)e.type);
	fatal("%s: failed to allocate %ld bytes.", progname, (long)size);

Regards,
	Jutta (jutta@cs.tu-berlin.de)