HDTenEightyP/NetNews huggingface dataset:
From: cpcahil@virtech.uucp (Conor P. Cahill)
Subject: Re: Checkpointable malloc library?
Organization: Virtual Technologies Inc.
Date: Tue, 13 Oct 1992 11:35:47 GMT

In article <1992Oct12.203426.4020@grebyn.com>, richk@grebyn.com (Richard Krehbiel) writes:
> 
> Here's what I'd like to be able to do:
> 
>   for(;;) 
>   {
>     chkpt = malloc_chkpt();
>     if(setjmp(jmp_b))    
>     {
>       malloc_restart(chkpt); 
>       continue;
>     }
>     work_process();  
>     malloc_forget(chkpt); 
>   }

The problem with this is that you would have to ensure that no function 
called by work_process() has allocated memory and expects it to still be
there.  This is a pretty easy thing to do within your own code, but almost
impossible to do with routines from libc, many of which allocate buffers 
that are not freed until the program exits.

In UNIX you could do just about the same thing by doing an exec() of yourself
which will just start you over without any extra allocations lying around.


-- 
*** SENTINEL(tm) The ultimate Debugging Environment - email for more info ***

Conor P. Cahill              (703)430-9247            cpcahil@virtech.vti.com
Virtual Technologies, Inc.  46030 Manekin Plaza          Dulles, VA 20166 
Newsgroups: comp.lang.c
From: "hans friedrich steffani" <GM08@DKAUNI2.BITNET>
Subject: Re: comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ)
Organization: University of Karlsruhe, Germany
Date: Fri, 16 Oct 1992 12:42:32 GMT



> From: scs@adam.mit.edu (Steve Summit)
> 6.6:    How can I use a preprocessor #if expression to detect
>         endianness?
what is endianness or what does big endian mean? Sorry I am
not a nativ speaker and cannot find this term in my dictionary.


hans friedrich steffani
uni karlsruhe
germany
gm08@dkauni2.bitnet
steffani@imbaibrs1.bau-verm.uni-karlsruhe.de
Newsgroups: comp.lang.c
From: rscott@spock.NMSU.Edu (Joseph Good)
Subject: Parallel functions on Unix?
Organization: New Mexico State University
Date: Sun, 11 Oct 1992 21:37:25 GMT


Because Unix systems multi-task, is it possible to have two (or more) functions  
run simultaneously in a standard C program?

Here is what I am trying to do:

I am making an animation program to feed into a ray tracer.
It has the variables X, Y, and Z defined globally.

I have a number of functions that modify the position vector, such
as a line from p1 to p2, a circle.. curve..  But when called 
individually, they are jumpy.  Going from a curve to a line
is a sudden jolt.  So, I was wanting one function to kick in 
while the other one was going.  It can modify the line function
with a curve and give it a smooth effect.

I can do this in some huge loop, but I figured I would ask if it was possible  
before I started building code...

Thanks!

-jdg

--

Joseph Good
+-------------------+ - More than just a band....
| Green Dot Brigade | - It's a whole damn army of dots...
+-------------------+ - And we've declared war on the 7-Up dots...

rscott@nmsu.edu (NeXT mail welcome!!) (main account)

atlantis@acca.nmsu.edu  (Just plain ol' Unix) (seldom used)
From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
Newsgroups: comp.lang.c
Subject: Re: Determining variable type at run-time (followup q.)
Date: 9 Oct 92 08:44:23 GMT
Organization: University of Helsinki

hartman@ulogic.UUCP (Richard M. Hartman) writes:
>C'mon folks, it's only a code FRAGMENT in an article, it's 
>not a production program!

True, but you claimed it was safer than another code fragment.  Since it
was not particularly safe, I see no reason why its shortcomings should
not be discussed.  In general, any and all code posted as examples to
comp.lang.c is ripe for being dissected and discussed to death.  Being
impolite and/or engaging in flamefests is, or course, always
discouraged.

--
Lars.Wirzenius@helsinki.fi  (finger wirzeniu@klaava.helsinki.fi)
Xref: sparky comp.lang.c:14758 comp.software-eng:3683 comp.sys.mac.programmer:16739
From: martinc@grover.cs.unc.edu (Charles R. Martin)
Newsgroups: comp.lang.c,comp.software-eng,comp.sys.mac.programmer
Subject: Re: Productivity of a C programmer ?
Date: 9 Oct 92 23:31:05 GMT
Followup-To: comp.lang.c
Organization: UNC Department of Computer Science
In-reply-to: mhughes@comtch.spk.wa.us's message of 9 Oct 92 18:09:01 GMT

In article <qX3DsB2w165w@comtch.spk.wa.us> mhughes@comtch.spk.wa.us (Mark Hughes) writes:

     The best thing to do is to ask a programmer to evaluate how long it 
   will take a team to write your project, and then add 20% or so...

... multiply by 2, and convert to the next highest unit.  (I.E., if the
original estimate is 2 hours, make that 2.4 hours, 4.8 hours, and
finally 4.8 days....)
--
		Charles R. Martin/(Charlie)/martinc@cs.unc.edu
     Dept. of Computer Science/CB #3175 UNC-CH/Chapel Hill, NC 27599-3175
	    3611 University Dr #13M/Durham, NC 27707/(919) 419 1754
		 Remember what the little cake said to Alice.
Newsgroups: comp.lang.c
From: bibhas@pico.engr.mun.ca (Bibhas Bhattacharya)
Subject: Re: Calling FORTRAN from C; Losing sleep.
Keywords: FORTRAN
Organization: Memorial University of Newfoundland
Date: Wed, 7 Oct 1992 13:26:41 GMT

Thanks everybody for sending me help. I should have really RTFM more
carefully, however I simply panicked in the work pressure I'm going thru.
Thanks again.
Bibhas.
From: jos@and.nl (Jos Horsmeier)
Newsgroups: comp.lang.c
Subject: Re: Volatile variables and optimization
Date: 16 Oct 92 09:22:16 GMT
Organization: AND Software BV Rotterdam

In article <1bkj93INN1m1@fnnews.fnal.gov> votava@fndaud.fnal.gov (Margaret Votava) writes:
|Hi,
|
|	I've got a simple question about the correct behavior of the ANSI
|C compiler regarding volatile variables. I have a memory location that I 
|simply want to read. I don't want to do anything with the result; it is
|just a hardware location that needs to be touched.
|
|	The following piece of code will access the location when compiled
|without optimization, but is optimized out when optimization is turned on in 
|the compilation command.
|
|	I thought the point of volatile was to *always* fetch the value
|from memory.
|
|int junk()
|{
|	volatile unsigned short *mem_addr;
|	mem_addr = (volatile unsigned short *) 0x3000;
|	(void) *mem_addr;
|}

I think you're right and your compiler is completely wrong. Let's have
a look what the standard says about this:

3.5.3 Type qualifiers

`An object that has volatile-qualified type may be modified in ways
unknown to the implementation or have other unknown side effects. 
Therefore any expression referring to such an object shall be 
evaluated strictly according to the rules of the abstract machine,
as described in 2.1.2.3.'

And in 2.1.2.3 Program execution, it reads:

`In the abstract machine, all expressions are evaluated as specified
by the semantics. An actual implementations need not evaluate part of
an expression if it can deduce that its value is not used and that
no needed side effects are produced (including any caused by calling
a function or accessing a volatile object).'

My ISO 9899 standard mentions in a footnote: (*)

`A volatile declaration may be used to describe an object corresponding
to a memory mapped input/output [ ... ] Actions on objects so declared
shall not be ``optimized out'' by an implementation or reordered except
as permitted by the rules for evaluating expressions.'

So, your compiler violated one of the holy `shall clauses' and goofed
completely by optimizing out the pointer dereference in you junk()
function. It erroneously deduced that dereferencing the pointer does
_not_ produce any side effect.

I think the only remedy is to turn off optimization for this function ...

kind regards,

Jos aka jos@and.nl

(*) I'm not sure whether or not the footnotes in the ISO 9889 and the
    original ANSI standard are the same. 
Newsgroups: comp.lang.c
From: atbowler@thinkage.on.ca (Alan Bowler)
Subject: Re: Strings and integer sizes
Organization: /etc/organization
Date: Tue, 13 Oct 1992 23:39:35 GMT

In article <1992Oct9.125347.24160@blaze.cs.jhu.edu> wilson@rhombus.cs.jhu.edu (Dwight Wilson) writes:
>In article <1992Oct9.074449.12228@klaava.Helsinki.FI> wirzeniu@klaava.Helsinki.FI (Lars Wirzenius) writes:
>>>:`An array of character type may be initialized by a character string
>>>:literal, optionally enclosed in braces. Successive characters of the
>>>:character string literal (including the terminating null character
>>                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>:if there is room or if the array is of unknown size) initialize the
>>  ^^^^^^^^^^^^^^^^
>>>:elements of the array.'
>>
>>The initialization
>>
>>	char zoe[3] = "abc";
>>
>
>Does anyone know what the rationale was for accepting this form?
>It's won't necessarily work on pre-ANSI compilers (in fact
>I expect it would break on most of them) so the excuse of 
>maintaining compatibility with old code doesn't apply.  

The rationale is simple it has worked like this and been accepted
since the very early days of C even before K&R I.  I don't recall
ever having seen a C compiler that did not accept this.  
I have been using C since Unix release 5.  (Before such newfangled
features such as "long", "unsigned", and "typedef" :-) )

The compatibility argument most certainly does apply.
From: brettw@matt.ksu.ksu.edu (Brett D. Watson)
Newsgroups: comp.lang.c
Subject: Awk to C translator
Date: 16 Oct 1992 16:02:07 -0500
Organization: Kansas State University
Distribution: usa
NNTP-Posting-Host: matt.ksu.ksu.edu

  Does anyone know if a shareware version of an Awk/C translator
exists?  Something that actually translates Awk scripts to C code and
compiles to an executale?

-=- Brett
-- 
Brett Watson, Database/System Administrator
Office of Judicial Administration, Topeka, KS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
brettw@matt.ksu.ksu.edu | brettw@holonet.net
Xref: sparky comp.lang.c:14847 comp.software-eng:3723 comp.sys.mac.programmer:16832
From: paj@uk.co.gec-mrc (Paul Johnson)
Newsgroups: comp.lang.c,comp.software-eng,comp.sys.mac.programmer
Subject: Re: Productivity of a C programmer ?
Date: 12 Oct 92 07:56:34 GMT
Reply-To: paj@uk.co.gec-mrc (Paul Johnson)
Organization: GEC-Marconi Research Centre, Great Baddow, UK

In article <qX3DsB2w165w@comtch.spk.wa.us> mhughes@comtch.spk.wa.us (Mark Hughes) writes:

[On project estimation]

>  The best thing to do is to ask a programmer to evaluate how long it 
>will take a team to write your project, and then add 20% or so...

I have heard one method proposed semi-seriously: ask a new graduate
for his estimate, double it, and then switch to the next highest
units.  So if the graduate says two months, allow four years.

Paul.

-- 
Paul Johnson (paj@gec-mrc.co.uk).	    | Tel: +44 245 73331 ext 3245
--------------------------------------------+----------------------------------
These ideas and others like them can be had | GEC-Marconi Research is not
for $0.02 each from any reputable idealist. | responsible for my opinions
Newsgroups: comp.lang.c
From: cbuckley@unix1.tcd.ie (Colm Buckley)
Subject: ETI library for DOS etc?
Organization: Trinity College, Dublin
Date: Thu, 8 Oct 1992 12:46:06 GMT

Question - is there an implementation of the Extended Terminal Interface
library (PANEL, FORM/FIELD, MENU/ITEM etc.) as supplied with SCO UNIX
development system and other UNIX systems for DOS, or even a portable
version which can run on top of curses on UNIX machines which don't have
ETI supplied as standard?

Reply by EMAIL please - I don't have time to read this group normally :-(

Any help would be appreciated.
--
Colm.
+-------------------------------------+----------------------------------+
| Colm Buckley                        | "My program doesn't work."       |
| Computer Science,                   | "You forgot the semicolon."      |
| Trinity College, Dublin 2, Ireland  | "But..."                         |
|                                     | "Line 376. Check."               |
| cbuckley@unix1.tcd.ie               | "But..."                         |
| CBUCKLEY@vax1.tcd.ie                | "Trust me."                      |
+-------------------------------------+----------------------------------+
Newsgroups: comp.lang.c
From: pjh@mccc.edu (Pete Holsberg)
Subject: Re: Strings and integer sizes
Organization: The College On The Other Side Of Route One
Date: Tue, 13 Oct 1992 15:48:23 GMT

In article <1992Oct12.164905.11901@athena.mit.edu> scs@adam.mit.edu (Steve Summit) writes:
=Finally, in article <1992Oct10.181249.26069@mccc.edu>, Pete Holsberg (pjh@mccc.edu) writes:
=> In article <1992Oct9.173755.18595@athena.mit.edu> scs@adam.mit.edu (Steve Summit) writes:
=>= (It's been mentioned several times during this thread, but
=>= "string" is a weakly-defined concept in C, not a formal part of
=>= the language except by convention, and by the fact that string
=>= literals generate them and many standard library routines expect
=>= them.)
=> 
=> I believe that string is quite well-defined: it's a constant.
=
=Don't you mean "string literal"?

Yes.

=A string literal is a
=well-defined lexical element (i.e. it exists only in source code
=at compile time); ANSI X3.159 defines it in section 3.1.4 .

And what does the compiler do with it?

=> We're
=> running into semantic problems here. For example, which of the following
=> is an "int", given the declaration "int count;"?
=> 	a. 7
=> 	b. count
=> Both are, because loosely speaking, an int is either an int variable or
=> an int constant. Or perhaps neither is, because the question wasn't
=> specific enough.
=
=Er, yeah.  (Vaguely worded questions and imprecisely defined
=terms, though rampant in comp.lang.c and indeed all of Usenet,
=are not really "semantic problems," at least as the term
="semantic problem" is commonly used in comp.lang.c :-) .)

Ok. Let's define the terms we use to define the terms we use to def.... ;-)

Pete

Newsgroups: comp.lang.c
From: herman@nosc.mil (John W. Herman)
Subject: Re: lint
Organization: Naval Ocean Systems Center, San Diego, CA
Date: Wed, 7 Oct 1992 14:35:01 GMT

wietse@wzv.win.tue.nl (Wietse Venema) writes:

>xu@prim.rose.utoronto.ca (Jiefeng Xu) writes:

>>I am new to lint. 

>Gcc understands standard C and "old" C.

Why doesn't the FSF have a lint that works with GCC??
Newsgroups: comp.lang.c
From: hollasch@kpc.com (Steve Hollasch)
Subject: Re: you probably already know this about prototypes
Summary: Formal argument promotion types
Organization: Kubota Pacific Computer, Inc.
Date: Thu, 15 Oct 1992 20:36:58 GMT

[ murphy@npri6.npri.com (David P. Murphy) writes about getting bitten by
[ argument promotion when using function prototypes & traditional K&R
[ declarations.

    I'm also porting to an Alpha and am also relentlessly prototyping every
function I see.  With respect to parameter promotion, you should also watch
out for float -> double promotion.  I believe that the following is a
complete list of types that are promoted in traditional C or in ANSI-C where
a prototype is not present:

        char            ---> int
        unsigned char   ---> int
        short           ---> int
        unsigned short  ---> double
        float           ---> double

______________________________________________________________________________
Steve Hollasch                                   Kubota Pacific Computer, Inc.
hollasch@kpc.com                                 Santa Clara, California
Newsgroups: comp.lang.c
From: bena@yoyo.cc.monash.edu.au (Ben Aveling)
Subject: Re: 'make' woes (won't catch secondary dependancy)
Organization: Monash University General Access Unix
X-Newsreader: TIN [version 1.1 PL6]
Date: Sat, 10 Oct 1992 04:57:26 GMT

My biggest complaint about make is getting it keep
the objects anywhere but the current directory.

And I hate the idea of `touch'ing any file that hasn't
really changed, it makes keeping track of your
files so much harder than it ever should be.

Ben
Newsgroups: comp.lang.c,comp.lang.c++,comp.lang.eiffel,comp.compilers
From: keck@castor.trl.OZ.AU (Brian Keck)
Subject: Re: Request for info - Software Testing Tools
Reply-To: keck@castor.trl.OZ.AU (Brian Keck)
Organization: Telecom Research Labs, Melbourne, Australia
Date: Fri, 9 Oct 1992 08:16:12 GMT
Keywords: tools, testing, question

In comp.software-eng, scip2060@nusunix1.nus.sg (SARDJONO INSANI) asked:
	REQUEST FOR INFO - SOFTWARE TESTING TOOLS
	Could anyone please give me information on software testing tools
	commercially available, with brief comments of their functionality,
	price and address of vendors?

I have what I guess is a similar question.

What I have in mind are tools that take up where lint leaves off, for C
primarily, but also C++ & Eiffel.

I've seen the thread on Purify/dbmalloc/Sentinel, but am more interested
in programming style as it affects maintainability & other good things
(reliability, efficiency, portability, interoperability, ...).

Thanks for any help,

Brian Keck

b.keck@trl.oz.au, phone +61 3 253 6407, fax +61 3 253 6362 
Network Services & Signalling, Telecom Research Laboratories
770 Blackburn Rd, Clayton Victoria 3168, Australia
-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.
Newsgroups: comp.lang.c
From: seksie@cs.montana.edu (Robin Winslett)
Subject: problem with byacc/flex/bcc2.0
Organization: Dept. of Computer Science, MSU, Bozeman Mt 59717
Date: Wed, 14 Oct 1992 19:09:30 GMT

I am in the process of porting a yacc/lex language spec to a PC using
byacc/flex and compiling with Borland C++ version 2.0.  I've gone in and 
redefined YY_INPUT, set up yyin and I have yylex performing okay in all
but the following:

	If I try to compile using the large or huge memory
	model, yylex hangs.  The reason I know that it's
	yylex is that I have it in a loop and I print both
	before and after the yylex call.  It doesn't hang 
	in the same spot every time, and it will scan for
	awhile but then it just quits.

Any help that I could get would be appreciated.

I also posted this to comp.compilers, but because of the bcc element, I felt
it was also apprpriate to try here.
-- 
Robin Winslett               seksie@cs.montana.edu              (406) 994-5959
##############################################################################
--- Obligatory Quote:
Gee Ricky!  I'm real sorry your mom blew up!      - Lane Myer, Better Off Dead
From: A4422DAJ@vm.univie.ac.at (Christian Cenker)
Subject: answer: graphics in C C++ for DOS
Organization: University of Vienna
Date: Tue, 13 Oct 1992 15:55:49 GMT


> In Borland  C++, I am trying to include a picture file of any sort at the
> beginning.  Does anybody know how one could accomplish this?
> (The code would help)

-----
> Gordon Davidescu, Princeton High School BBS

first of all you need the specific driver for your graphic card -
that's not always an easy job to do

you find a lot of drivers and sources for c c++ and borland (DOS)
on the trickle file servers

      simtel20.army.mil
or
     wuarchive.wustl.edu

in directories (hope i get the right name) like

      pub/msdos/borland or pub/systems/msdos/borland
     .... /c, .../cplusplus,  .../vga etc

chris
From: jbr0@cbnews.cb.att.com (joseph.a.brownlee)
Newsgroups: comp.lang.c
Subject: Re: NO NUMBERS! (or even SHORT INTS!)
Date: 7 Oct 92 11:28:30 GMT
Organization: AT&T

In article <9227814.1536@mulga.cs.mu.OZ.AU> fjh@munta.cs.mu.OZ.AU (Fergus James
HENDERSON) writes:
> > In article <1992Oct2.083136.11412@ITcorp.com> geoff@ITcorp.com (Geoff
    Kuenning) writes:
> >
> > > (1) It is generally a mark of weak programming
> > > (2) It is generally poor practice
> > > (3) It is *always* poor practice
>
> I have *never* seen programmers use named constants in a situation where
> they should obviously be using literals, but I have seen the converse
> error *far* too many times.

In general, I agree, but I have seen a case of the above in production code,
written by a novice programmer who had been told that they should use symbolic
names rather than constants in their code, so they did the following:

	#define	ONE	1
	#define	TWO	2
	#define	THREE	3
	/* etc. */

They then proceeded to use the "symbolic names" whereever they would have used
the numbers, regardless of context.  The person had used the constant TWELVE to
represent the size of a string buffer.  As you might guess, a bug was found
such that they had forgotten space for the terminator, so the program ended up
like this:

	#define	TWELVE	13

The moral (for me, anyway): use *real* symbolic names where they make sense to
hide "magic numbers", and not just for the sake of following a rule.
-- 
   ^      _   Joe Brownlee, Analysts International Corp. @ AT&T Network Systems
  /_\  @ / `  471 E Broad St, Suite 2001, Columbus, Ohio 43215   (614) 860-7461
 /   \ | \_,  E-mail: joe@cbcosmos.att.com   Yes, I speak for my company - NOT!
 "Scotty, we need warp drive in 3 minutes or we're all dead!" --- James T. Kirk
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.lang.c
Subject: Re: Lookup table location
Date: 13 Oct 1992 17:33:50 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
NNTP-Posting-Host: telecaster.think.com

In article <1166@emoryu1.cc.emory.edu> pdomain@emory.edu (Mike Mitten) writes:
>Say we have the following function, in its own file:
>
>char *dayname(int day)
>{
>static char *days[] =
>     {
>       "Monday",
>       "Tuesday",
>       "Wednesday",
>       "Thursday",
>       "Friday",
>       "Saturday",
>       "Sunday"
>     }
>
>  if (day < 1 || day > 7)
>	return "";
>
>  return days[day - 1];
>
>}
>
>Is there going to be any difference between putting the array
>'days' insided or outside the function?  

No.

>					  Obviously we don't want
>the array name polluting the user's name space, 

If you move it outside the function but keep the "static" modifier, it will
only be visible within that source file, and still won't pollute the user's
namespace.  This would be useful if this source file also had a function
that translated a day name to a number by searching the "days" array.
These two functions should both have access to the same array.

>						 nor do we want the
>user to be writing through the pointer they are returned (though I
>don't know that there's anything to be done about this in C).

You can declare the variable with "static const char *days[] = ...", and
prototype the function "const char *dayname(int day)".  The caller will be
forced to use a "const char *" variable to hold the result (unless he
explicitly casts the result to a non-const).

>It seems to me that the location of the definition of 'days' won't
>make any difference, but I'd like to be sure.

As far as the caller is concerned, there's no difference.  Names declared
"static" are never visible outside their source file.

-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
From: hartman@ulogic.UUCP (Richard M. Hartman)
Newsgroups: comp.lang.c
Subject: Re: NULLing a pointer and INT 0x1c
Date: 9 Oct 92 16:54:45 GMT
Organization: negligable

Thanks, Dwight.  I'm still trying to figure out all the permutations,
which is why I asked for a double-check.

"const" is another one in C++ that gets confusing (although I think
I've got that one figured out now.....)

	const char const *func(int) const;

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Oh I give my life so lightly		|
to my gentle lady.			|	-Richard Hartman	
Giving freely, and completely,		|	hartman@uLogic.COM
for my lady.				|