HDTenEightyP/NetNews huggingface dataset:
From: darcy@druid.uucp (D'Arcy J.M. Cain)
Subject: Re: Where are literals stored?
Date: Sat, 21 Nov 1992 15:13:21 GMT
Organization: D'Arcy Cain Consulting

I wrote:
>static char *a = "ABC";
>...
>char *a = "ABC";
>
>Of course the variables should probably be declared const in this case.

I meant that the variable should be declared as pointing to a const:

static char const *a ...

We don't have to start *that* discussion again.  :-)

-- 
D'Arcy J.M. Cain (darcy@druid.com)  |
D'Arcy Cain Consulting              |   There's no government
Toronto, Ontario, Canada            |   like no government!
+1 416 424 2871          DoD#0082   |
Newsgroups: comp.lang.c
From: blume@kastle.Princeton.EDU (Matthias Blume)
Subject: Re: Pascal as C prelude?
Reply-To: blume@kastle.Princeton.EDU (Matthias Blume)
Organization: Dept. of Computer Science, Princeton University
Date: Sat, 21 Nov 1992 18:18:10 GMT

In article <3903@dozo.and.nl>, jos@and.nl (Jos Horsmeier) writes:
|> 
|> My advice is: study Pascal first and when you think you've got a firm
|> notion of pointers, pointer arithmetic, dynamic memory allocation and
		       ^^^^^^^^^^^^^^^^^^
|> all sorts of wonderful stuff, switch to C. 
|> 
	Pardon me!?  How should you get a firm notion of THAT by learning
	Pascal????

|> #define SILLY_MODE
|> #ifdef SILLY_MODE
|> 
|> There's just one drawback, when you do this: you'll end up writing
|> ugly formatted code like:
|> 
|> if (condition)
|> 	{
|> 	statement1;
|> 	statement2;
|> 	}
|> 
|> instead of the proper:
|> 
|> if (condition) {
|> 	statement1;
|> 	statement2;
|> }
|> 
|> #endif

# define SERIOUS_MODE
# ifdef SERIOUS_MODE

The real problem is not, that those C-programs LOOK LIKE Pascal programs ---
they ARE Pascal programs with a slightly different syntax.  I've seen a lot
of ``so-called'' C programs showing that their programmers didn't really learn
C but only how to ``hand-translate'' Pascal code (or whatever) into C.

:-(

# endif

-Matthias
From: mitch@nosc.mil (Ray Mitchell)
Newsgroups: comp.lang.c
Subject: Rewinding A File In the "a+" mode
Date: 23 Nov 92 16:03:48 GMT
Organization: Naval Ocean Systems Center, San Diego, CA


Last week I posted a question concerning different results obtained
when rewinding a file opened in the "a+" mode on MS-DOS and UNIX
systems.  Today I noticed that the last 70 or so postings on this
newsgroup are for some reason unavailable.  If anyone responded to
my posting I would appreciate it if they could e-mail me their
response since I still need the information.

Lost on the internet:
Ray Mitchell
Xref: sparky comp.lang.c:16807 comp.lang.c++:16578
From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
Newsgroups: comp.lang.c,comp.lang.c++
Subject: Re: Converting an int or a float into a string*???
Date: 19 Nov 92 18:28:08 GMT
Organization: University of Helsinki

warlok@rhps.chi.il.us (Jon L Fincher) writes:
>You could try to standard C function fcvt(), which tranlates a float to
>a string.

fcvt is not standard, especially not the ANSI/ISO standard.  Just use
sprintf.  (FAQ, 12.3)

--
Lars.Wirzenius@helsinki.fi  (finger wirzeniu@klaava.helsinki.fi)
   MS-DOS, you can't live with it, you can live without it.
Newsgroups: comp.lang.c,comp.lang.c++,alt.tasteless.jokes,rec.humor
From: blume@tyrolia.Princeton.EDU (Matthias Blume)
Subject: Re: *** IMPORTANT DISCOVERY ***
Reply-To: blume@tyrolia.Princeton.EDU (Matthias Blume)
Organization: Dept. of Computer Science, Princeton University
Date: Mon, 16 Nov 1992 17:19:04 GMT

In article <MJN.92Nov16010838@pseudo.uucp>, mjn@pseudo.uucp (Murray
Nesbitt) writes:
|> knaggs@cps.msu.edu (Scott A Knaggs) writes:

[all this repeated tasteless nonsense deleted]
|> 
|> Not if you want your code to be portable to other compilers.  Some
|> compilers, notably gcc, have extensions to the language that make this
|> kind of thing possible, but in the majority of implementations this
|> code will result in undefined behavior.
|> 
|> -- 
|> Murray

That's a bad joke, and we have a word in German for people like you and
Mr. Knaggs: Schwein!  I hope, you will get off this newsgroup immediately!

-Matthias
From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
Newsgroups: comp.lang.c
Subject: Re: Idle Questions about ANSI C
Date: 17 Nov 92 12:38:03 GMT
Organization: McGill Research Centre for Intelligent Machines

In article <BxqBp1.5M6@netnews.jhuapl.edu>, bandy@netnews.jhuapl.edu (Mike Bandy) writes:
> pjh@mccc.edu (P. J. Holsberg) writes:

>> 1) Is "size_t" ever not the same as "unsigned int"?

It is allowed to be.

> According to K+R 2nd ed, section A7.4.8, size_t is "an unsigned
> integral constant; the particular type in implementation defined".

Well, the result of sizeof is the quoted thing, and it notes that
<stddef.h> defines the type in question as size_t.

Now: is it required that size_t be the same as one of the four usual
unsigned integral types?  (How about ptrdiff_t?)

> If you need it to be unsigned int, then cast it's type explicitly;
> this makes for more portable code.

Meaning, presumably, that you'd rather portably print the meaningless
value generated by throwing away those extra bits.  (On a putative
system which has size_t larger than unsigned int.)

If you need to print out a size_t and need it to be portable (as
opposed to, say, debugging code), cast it to the largest unsigned type
known to be available, unsigned long.

					der Mouse

			    mouse@larry.mcrcim.mcgill.edu
Newsgroups: comp.lang.c
From: aem@news.miami.edu (andrew mossberg)
Subject: putenv question
Organization: R.S.M.A.S.
Distribution: na
Date: Mon, 23 Nov 92 20:43:30 GMT


I'm trying to read a file and place lines found there into the environment
via putenv, but it isn't cooperating.  It works fine when I hardcode
values into the putenv calls, like putenv("SSS=adas");, but reading
a file using fgets() and then putenv'ing the line (sans trailing newline)
only leave the last line in the environment. Obviously I'm doing something
wrong with pointers, but I can't figure out what.  Please, someone, tell
me what idiotic mistake I'm making this time! This is on a HP 9000/720
running HP/UX 8.0.7

aem

-- 
a.e.mossberg	Symbiosis Corporation	Miami, Florida	aem@symbiosis.ahp.com
(305) 597-4110  fax: (305) 597-4002     alt mailbox: aem@umigw.miami.edu
From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
Newsgroups: comp.lang.c
Subject: Re: How to use 'return' in c?
Date: 19 Nov 92 18:21:58 GMT
Organization: University of Helsinki

rene@hamel.uucp (Rene Mueller) writes:
>There are a lot of compilers where [EXIT_SUCCESS and EXIT_FAILURE
>don't] exist...

So then you add 

	#ifndef EXIT_SUCCESS
	#define EXIT_SUCCESS 0
	#endif

	#ifndef EXIT_FAILURE
	#define EXIT_FAILURE 1
	#endif

to port.h or whatever.  This way you can make your code more close to
the standard without hurting portability.  Using explicit exit(1)'s
hurts portability as well.

--
Lars.Wirzenius@helsinki.fi  (finger wirzeniu@klaava.helsinki.fi)
   MS-DOS, you can't live with it, you can live without it.
Newsgroups: comp.lang.c
From: dfuller@portal.hq.videocart.com (Dave Fuller)
Subject: Re: Multiple Parameter Passing (unspecified number)
Organization: VideOcart Inc.
X-Newsreader: Tin 1.1 PL3
Date: Tue, 17 Nov 1992 20:36:57 GMT

n8743196@henson.cc.wwu.edu (Jeff Wandling) writes:
: 
: System: Sun 3/50, SunOS 4.1.1b
: 
: I'm trying to do a similar thing, except my function doesn't know what type
: to expect.  The next "variable argument" could be any simple type.  How
: do I deal with this?  Is there a way to switch on the type of the next
: argument? When using union's for example---
: 
: 
:   hash_insert(table,name,...) 
:   ....
:   {
:     
:     ....
:     va_list argp;
: 
:     type = va_"type?"(argp,???);
:     
:     ....
:    }
: 

Only if used like printf().  Printf knows what to cast the next parm as 
because you tell it what type you are passing it in the display description
string.  i.e. "num %d: name:%s"
printf will cast the first parm to an int, the second to a char*.
If you want pass random types, you have to also give the routine a way
of knowing what the values are supposed to be.

Dave Fuller
dfuller@portal.hq.videocart.com

Newsgroups: comp.lang.c
From: rene@hamel.uucp (Rene Mueller)
Subject: Re: The Correct Way To Write C if-Statements
Organization: Free University of Berlin, Germany
Date: Mon, 23 Nov 1992 22:12:50 GMT

In article <1992Nov20.093957@gese.ge14.mdadv.gv.at>, sca@gese.ge14.mdadv.gv.at (Petzi Schweda) writes:
|>
|> think you'll end up a little bit messy when using this one inside blocks:
|>
|> for (...)
|>     {
|>     if  (cond)
|>     {
|>         state;
|>     }
|>     else
|>     {
|>         state2;
|>     }
|>     }
|>
|> too much paranthesis in this column, for my taste ...
|>
Yeah. But what if you write it this way:
for(...)
{
	if(cond)
	{
		statement1;
	}
	else
	{
		statement2;
	}
}

If you think I have too many <tab>'s use <space> instead...

	rene@math.fu-berlin.de
From: ch981@cleveland.Freenet.Edu (Tony Alicea)
Newsgroups: comp.lang.c
Subject: Looking for "c" language to PDL Converter
Date: 16 Nov 1992 21:54:10 GMT
Organization: Aeronautical Radio, Annapolis
Reply-To: talicea@arinc.com
NNTP-Posting-Host: hela.ins.cwru.edu



	I am looking for a product that will take a "c" language code
source program and generate PDL from it. Does anybody know of such
animal?

	Please "Reply-To:" above e-mail address.

	Thanks!

Tony Alicea
talicea@arinc.com
From: vugranam@pike.ee.mcgill.ca (Vugranam Chakravarthy Sreedhar)
Newsgroups: comp.lang.c
Subject: Memory Info.
Date: 20 Nov 92 13:09:13 GMT
Organization: McGill University - VLSI Laboratory, Montreal, CANADA.


Given a pointer to a object that has been previously allocated using
one of the allocation routine, how can I get the
size of the object.

For example,

char *c;
long  x ; 

 c = (char *) malloc (100) ;
    .
    .
    .

x = mem_size(c) ;   /* x is block size of c, which in this case is 100 */


I want to use this to keep track of memory statistics. Now what I do is
to pass the size to my memory routines. Like

int *mymalloc(size) ;  /* this is easy */

int myfree(char *, long size)   /* I don't like this !!*/

Thanks


Sreedhar
Xref: sparky comp.lang.c:16729 comp.software-eng:4372
From: dougv@vnet.ibm.com (Doug Valkenaar)
Date: Wed, 18 Nov 92 10:46:08 PST
Newsgroups: comp.lang.c,comp.software-eng
Subject: Wanted: Supported equivalent of FileMerge
Reply-To: dougv@vnet.ibm.com
Organization: ROLM
Disclaimer: This posting represents the poster's views, not those of IBM
News-Software: UReply 3.0

Does anyone know of a "FileMerge" type program which allows you to visually
merge two files into a third one with selected parts from each of the
originals?  SUN used to distribute such a program, but it's only SunView
(I'd like OpenLook), and it's no longer supported.

Surely there's something like this in an 'X' or OpenLook GUI.

Thank you for your help.

----------------------------------------------------------------------
D. Douglas Valkenaar       ROLM PhoneMail         (dougv@vnet.ibm.com)
----------------------------------------------------------------------
Newsgroups: comp.lang.c
From: ckkoo@magnus.acs.ohio-state.edu (Chee K Koo)
Subject: C for loop
Organization: The Ohio State University
Date: Fri, 20 Nov 1992 13:43:43 GMT

I am new to C programming, while i was doing a numerical analysis
program which uses many for loop
here is the loop looks like

for(i=1;i<=n;i++);
{
}

i put the ";" after the loop header, when the program is excuted, the loop
is skipped, however, it works fine when the ";" is removed.

I just want to find out why the compiler does not catch it during
compilation. It is compiled with UNIX gcc.

Thanks

C. K. koo
From: Nico Tranquilli <ntranqu@caticsuf.cati.csufresno.edu>
Subject: Virtual memory Management Systems
X-Xxmessage-Id: <A72E8A71F5060B1B@mac2.di.unipi.it>
X-Xxdate: Tue, 17 Nov 92 10: 39:29 GMT
Organization: Department of Computer Science, Pisa University
X-Useragent: Nuntius v1.1.1d9
Date: Tue, 17 Nov 1992 10:37:46 GMT

Could anyone please tell me how to call the Hardware/Software needed
to manage virtual memory ?
--
nico.
From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
Newsgroups: comp.lang.c
Subject: Re: Reasons for using C vs. Fortran or vice/versa
Date: 20 Nov 92 10:08:50 GMT
Distribution: na
Organization: McGill Research Centre for Intelligent Machines

In article <ALANB.92Nov17130727@catalina.sdl.mdcbbs.com>, alanb@sdl.mdcbbs.com (Alan Braggins) writes:
[these attribution lines that are confused enough that I'm not sure who
writes what!]
>>>>>> On Fri, 13 Nov 1992 17:15:42 GMT, steve@taumet.com (Steve Clamage) said:
>> mroussel@alchemy.chem.utoronto.ca (Marc Roussel) writes:

>> This is the "aliasing" problem, and dramatically affects the
>> efficiency of mathematical code in C compared to Fortran.
> What happened to the proposed "noalias" type qualifier?

It was dropped.  It was extremely difficult, perhaps impossible, to
define its semantics precisely while avoiding, on the one hand,
weakening it so much as to be useless (to optimizers), and on the
other, making it so strong as to be useless (to code authors).  All the
proposed definitions of it were sufficiently confusing that even X3J11
couldn't figure out precisely what they meant.  Dennis Ritchie even
generated a quote which Henry Spencer put into his signature: "noalias
must go.  This is non-negotiable." [from memory - exact wording may be
wrong].

And sure enough, it was.  It's not clear to me what the right solution
is.  I'm sure compiler authors are experimenting with various
possibilities....

					der Mouse

			    mouse@larry.mcrcim.mcgill.edu
Xref: sparky comp.lang.c:16804 comp.lang.c++:16577 rec.humor:34345
From: norbert@wpi.WPI.EDU (Timothy James)
Newsgroups: comp.lang.c,comp.lang.c++,alt.tasteless.jokes,rec.humor
Subject: Re: *** IMPORTANT DISCOVERY ***
Date: 19 Nov 1992 18:13:54 GMT
Organization: Worcester Polytechnic Institute
NNTP-Posting-Host: wpi.wpi.edu

In article <BxxrJ2.G70@csn.org> mayer@teal.csn.org (Mike Mayer) writes:
>Lucky me.
>
>This is the first time I have ever checked out comp.lang.c.  This article
>was exactly the second one that I decided to read (it caught my
>attention).  I'll have to check into more newsgroups that I have
>not read to see what they are like.
>
>For the curious, the first one I read was apparently by a student
>trying to get someone to write his program for him 
>the title was "Can you program in C?"
>
>Mike4Mayer


HA HA HA Ha Ha ha ha HA HA ha hA HA HA HA
HA HA HA Ha Ha ha ha HA HA ha hA HA HA HA
HA HA HA Ha Ha ha ha HA HA ha hA HA HA HA
HA HA HA Ha Ha ha ha HA HA ha hA HA HA HA HA ha ha Ha!
I get it!
"Can you program in C!" 
This guys a riot!

HA HA HA Ha Ha ha ha HA HA ha hA HA HA HA
HA HA HA Ha Ha ha ha HA HA ha hA HA HA HA!!!!!




And now a tasteless joke...


Whats the same about all battered women?


THEY JUST DON'T FUCKIN LISTEN!

-- 
--------------
Timothy James McInerney 
tmcinern@feds26.Prime.com    "I wanna decide who lives 
norbert@wpi.wpi.edu           and who dies"  - Crow
Newsgroups: comp.lang.c
From: blume@kastle.Princeton.EDU (Matthias Blume)
Subject: Re: the abs() function in C
Reply-To: blume@kastle.Princeton.EDU (Matthias Blume)
Organization: Dept. of Computer Science, Princeton University
Date: Sat, 21 Nov 1992 03:03:12 GMT

In article <1992Nov20.162807.9120@magnus.acs.ohio-state.edu>,
sbbrown@magnus.acs.ohio-state.edu (Stephen B. Brown) writes:

|> Of course, if he's using ANSI style function prototype declarations,
|> then the compiler can complain about
|> 	abs(-2.0)
|> so then he's got another problem.  It was actually this example which

No, in this case the compiler will insert an automatic conversion.


-Matthias
Newsgroups: comp.lang.c,comp.software-eng
From: johnson@cs.uiuc.edu (Ralph Johnson)
Subject: Re: Will we keep ignoring this productivity issue?
Organization: University of Illinois, Dept. of Comp. Sci., Urbana, IL
Date: Fri, 20 Nov 1992 10:38:33 GMT

kambic@iccgcc.decnet.ab.com (Bonus, Iniquus, Celer - Delegitus Duo) writes:

In response to a probably too long article on my part:

>We are in the world of wild conjecture and the
>nature vs. nuture issue could go on forever.  We need to speak of data here.

Although there were probably many things wrong with my article, it was not
wild conjecture, and I was pointing to data.  The claim was made that,
like everything else, excellence in programming was something you either
had or didn't have, and trying to train someone to be a top programmer
was a mistake.  My point was that claim was completely rediculous.

It is true that there are very large differences in the skills of 
programmers.  It is also true that our theories of how to manage software
do not take account of this, and it should.  However, there is no reason
to believe that we cannot *someday* figure out what makes a good software
developer and figure out how to teach it to people.  Sure, there will
always be differences in people, but that does not mean that these
differences are ingrained since birth.   Most differences are acquired,
and that is true of most differences that make for good software
developers.  So, let's find out what these differences are and figure
out how to teach them!

In case anyone misunderstands me, I do NOT think that we know how to
teach much about software yet.  Most programming courses just present
syntax to students; some teach themselves and some do not.  There are
a few people who have some sort of theory about how to teach programming,
but these theories are not yet widely accepted.  There is even less agreement
when you move to higher levels of software development.  However, I think
that it is *possible* to come up with an effective theory of how to teach
software development, and that, given enough effort, we will eventually
do so.

For what is currently one of favorite approaches, see:
Linn, Marcia C. and Michael J. Clancy.  The Case for Case Studies of
Programming Problems.  Communications of the ACM  V. 35, N 3, March
1992, pp. 121-132.


Newsgroups: comp.lang.c,comp.software-eng
From: jeff@taumet.com (John Jeffrey Clark)
Subject: Re: Wanted: Supported equivalent of FileMerge
Organization: TauMetric Corporation
Date: Fri, 20 Nov 1992 23:29:54 GMT

dougv@vnet.ibm.com (Doug Valkenaar) writes:

>Does anyone know of a "FileMerge" type program which allows you to visually
>merge two files into a third one with selected parts from each of the
>originals?  SUN used to distribute such a program, but it's only SunView
>(I'd like OpenLook), and it's no longer supported.

>Surely there's something like this in an 'X' or OpenLook GUI.

Yes there is.  Sun has updated filemerge to work on OpenWindows 3.0.
It is part of the SPARCworks toolset.  I have used it, and it seems
to work very well.

-Jeff Clark
jeff@taumet.com


Newsgroups: comp.lang.c
From: jutta@opal.cs.tu-berlin.de (Jutta Degener)
Subject: Re: Is this ANSI?
Organization: Techn. University of Berlin, Germany
Date: Thu, 19 Nov 1992 12:48:58 GMT

kdq@quest.UUCP (Kevin D. Quitt) writes:
> struct FM
> {
>	short	data_len;
>	char	data[];        /*  This line is the kicker  */
> };
>
> Is [this] legal ANSI code?

No.  In
|	char	data[];

the member `data' has incomplete type [ANSI 3.5.4.2]. 
A structure or union shall not contain a member with
incomplete type [3.5.2.1, Constraints]; an ANSI C compiler
must at least emit a warning about this.

The `complete' alternative,
|	char	data[0];

is also illegal; the expression inside the []s must
have a value greater than zero [3.5.4.2, Constraints].

Jutta (jutta@cs.tu-berlin.de)
Newsgroups: comp.lang.c,comp.graphics
From: hollasch@kpc.com (Steve Hollasch)
Subject: Re: An apology to the world
Summary: AAAAAAAAAaaaaaaaaaaarrrrrrrrrrrgggggggghhhhhhh!
Organization: Satire & Vitriol, Inc.
Distribution: na
Date: Sat, 21 Nov 1992 21:28:34 GMT

2644danticoj@vms.csd.mu.edu (our intrepid nuclear submarine officer) writes:
| 
| It's Cetera again, and for the record, this will be his final logon to this
| network.  Rest assured C programmers, my posting of 16NOV92 was a joke...

    UUUuuuuuurgh!  You hoser!  I spent all that effort spoofing your spoof!
Satirizing your satire!  Joking about your joke!  I abase myself before you;
you had me completely fooled.  Sheesh; I finally started to wonder after
going over it for the fifth or sixth time, as it slowly bored into my thick
skull.  I even sent e-mail to your postmaster (wot a noodge!)

(heh, we should get together and compare e-mail responses, though.  My
best was from some lady who sent e-mail to my manager's manager, telling him
to make me stop it.  I had to stand in the corner for HOURS.  Turns out that
she was raised in the wild by a pack of librarians, though, so I guess it's
understandable.  =^)  

______________________________________________________________________________
Steve Hollasch                                          Satire & Vitriol, Inc.
hollasch@kpc.com                           Taken over by Nyuck Nyuck Et Cetera
From: torek@horse.ee.lbl.gov (Chris Torek)
Newsgroups: comp.lang.c
Subject: Re: question about duplicate declarations
Date: 19 Nov 1992 19:00:19 GMT
Organization: Lawrence Berkeley Laboratory, Berkeley
Reply-To: torek@horse.ee.lbl.gov (Chris Torek)
NNTP-Posting-Host: 128.3.112.15

In article <2R28E4L@math.fu-berlin.de> rene@hamel.uucp (Rene Mueller) writes:
>In a function there couldn't be a[nother] fuction definition..

True enough.  Function *declarations* are, however, permitted.

>So code like
>typ f1(paramlist)
>{
>typ f2(paramlist);
>	.
>	.
>	.
>}
>Shouldn't be in ANY programm...

ANSI C allows code of the above form.  The declaration for f2()
gives it the corresponding type, and the identifier goes out of scope
at the closing brace.

(Stylistically, I happen to agree; function declarations with block
scope provide nothing that the same declaration with file or global
scope would give, except the chance to make a mistake.)

>and things like
>typ f();
>means that f is a function with NO parameter returning a value from type typ

No.  In ANSI C, an empty parameter list means `the number and types of
the parameters are unspecified'.  This imposes a separate set of type
compatibility rules.  Note that this differs from C++, where `int f()'
means the same as ANSI C's `int f(void)'.

>... so typ f(paramlist) is a redeclaration with WRONG type

In ANSI C, the redeclaration is compatible (I called it `benign') if
and only if the return type is compatible, the parameters in the
`paramlist' all have `wide' types, and the actual function does not
take variable arguments.

An incompatible (`malignant') redeclaration is apparently permitted
under ANSI C.  If you call a function whose current in-scope
declaration is incompatible with the actual type of the actual
function, the result is undefined.  A future version of the standard
will probably outlaw malignant redeclarations (note, this is sheer
speculation on my part, and it does not completely eliminate the
problem, only one aspect of it).

Note that any compiler can issue warnings at any time, so a good compiler
can already warn about malignant redeclarations.  A diagnostic is not
required, but no diagnostic is ever forbidden.
-- 
In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 510 486 5427)
Berkeley, CA		Domain:	torek@ee.lbl.gov
Newsgroups: comp.lang.c