HDTenEightyP/NetNews huggingface dataset:
From: steve@taumet.com (Steve Clamage)
Subject: Re: assert
Organization: TauMetric Corporation
Date: Tue, 22 Dec 1992 16:39:28 GMT

lebrun@ll.mit.edu (Steven F. LeBrun) writes:


>>	The first alternative (#include <stdio.h>) is forbidden by the C
>>	Standard (standard headers may not #include other standard headers).
>                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

>I took a look at the ANSI C document (X3.159-1989) and could not find a
>section that states that standard header files cannot include other
>standard header files.  As a matter of fact, section 4.11.2 "Standard
>Headers" states that header files included in any order and may be 
>included more than once with the same effect as if they were included
>only once.  [There is an exception pointed out in this section about
>the <assert.h> header file.]

Taking the last first, a *program* may include the standard headers
in any order and any number of times.  This is not a license for
the *implementation* to do so.

There is no one sentence in the Standard which says that the standard
headers may not include one another, but it is an unescapeable
conclusion of ANSI section 4.1.2.1 (ISO 7.1.2.1), "Reserved Identifiers".

Let's take a simple example to see why.  If I do not include <stdarg.h>
in my program, the identifier va_start is not reserved, and I may use
it in any way that I like.  The following complete program is strictly
conforming:

	#include <stdlib.h> /* to get EXIT_SUCCESS */
	#include <stdio.h>  /* to get printf */
	int main()
	{
	    int va_start = EXIT_SUCCESS;
	    printf("Hello\n");
	    return va_start;
	}

A naive implementation might include <stdarg.h> in <stdio.h> so that
it would be easier to declare the v*printf functions.  That would
render this strictly-conforming program undefined.  Therefore, such an
implementation does not conform to the Standard.  Similar examples exist
for all the standard headers.

Instead, implementations must jump through a few hoops to get everything
done properly.  You can read about this in more detail in the book
"The Standard C Library" by P. J. Plauger, Prentice-Hall.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
Newsgroups: comp.lang.c
Subject: Re: allocating 2-d array
Date: 23 Dec 92 17:40:26 GMT
Organization: McGill Research Centre for Intelligent Machines

In article <1992Dec22.185523.4732@nynexst.com>, jsd@nynexst.com (Joseph Delotto) writes:

> I want to dynamically allocate a 2-d array for a variable defined as:

> int	**myarray;

> where the dimensions = nrows,ncols.  Currently I'm using the
> following code:

> myarray = (int **) malloc ((unsigned) nrows*sizeof(int*));
> for(i=0;i<=nrows;i++)
>      myarray[i] = (int *) malloc ((unsigned) ncols*sizeof(int));

> which seems to work ok but looks awfully sloppy.  Is there any way to
> get the whole thing done in one shot?

No, not unless it's "char **myarray", because only chars are known to
have no alignment restrictions.  But you can do it with only two
mallocs:

myarray = (int **) malloc(nrows*sizeof(int *));
myarray[0] = (int *) malloc(nrows*ncols*sizeof(int));
for (i=1;i<nrows;i++) myarray[i] = myarray[i-1] + ncols;

(Note that your initial code ran 0..nrows, not 0..nrows-1.  Thus, you
were writing into more memory than your first malloc allocated.)

If it *is* chars, you can do

 { char *tmp;
   tmp = malloc((nrows*sizeof(char *))+(nrows*ncols));
   myarray = (char **) tmp;
   tmp += nrows * sizeof(char *);
   for (i=0;i<nrows;i++) { myarray[i] = tmp; tmp += ncols; }
 }

but this depends on the alignment of char * being acceptable for char.
For no other type is the analogous restriction known a priori to be
satisfied, which is why this can be done only for chars.  (Unless, of
course, it's in machine-specific code where you don't mind depending on
the alignment behavior of your particular machine.)

					der Mouse

			    mouse@larry.mcrcim.mcgill.edu
Newsgroups: comp.lang.c
From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
Subject: Re: Another C palindrome puzzle
Organization: Computer Science, University of Melbourne, Australia
Date: Fri, 25 Dec 1992 21:28:26 GMT

mouse@thunder.mcrcim.mcgill.edu (der Mouse) writes:

>In article <9235703.672@mulga.cs.mu.OZ.AU>, fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
>> manus@evolving.com (Manus Hand) writes:
>
>>> how about a palindromic "Hello world" program, with no comments,
>>> #if's, #ifdef's, <<<OR #define's!>>>
>> I liked your idea of using #pragma.
>> Here's my solution with no comments, #ifs, #ifdefs, or #defines.
>
>> 	#pragma amgarp#;""\
>
>Oops.  What about the FrobozzCo compiler, which takes the "amgarp"
>pragma as a directive to place the author of the code into the world of
>_The World According to Garp_? [...]

Well... just so long as it still accepts the program :-).

>Or older versions of gcc, which would give up on compiling and run rogue
>when they happened across a #pragma of any sort?

I think that these versions of gcc are not standard-conforming.
I don't have the ANSI C standard, but the C++ ARM says that
"an unrecognized pragma will be ignored", and I think that the C standard
says something similar.

So the program should be fine on all conforming implementations that don't
recognize the pragma
 	#pragma amgarp#;""
ie., all conforming implementations ever actually implemented (but not of
course the FrobozzCo compiler with the -mumble option specified ;-)

But you're right of course, it's not strictly ANSI conforming.

-- 
Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
This .signature virus is a self-referential statement that is true - but 
you will only be able to consistently believe it if you copy it to your own
.signature file!

-- 
Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
This .signature virus is a self-referential statement that is true - but 
you will only be able to consistently believe it if you copy it to your own
.signature file!
Newsgroups: comp.lang.c
From: mitch@clsi.COM (Mitchell N. Perilstein)
Subject: Re: C code Layout
Organization: CAD Language Systems, Inc.
	<1992Dec23.165659.3298@mfltd.co.uk>
Date: 24 Dec 92 10:57:49

> P.S I've got some macros for vi that solve mazes. Try that in poo. Sorry,
> EMACS.

I've got some lisp for emacs which emulates vi.  Does vi emulate emacs?

---
 Mitchell N. Perilstein   CAD Language Systems, Inc.   410-992-5700 x225 
 Member, League for Programming Freedom.  Mail lpf@uunet.uu.net for info.

PS:  Style B, please.
PPS: Haven't you read ``The Tao of Poo?''  :-)

Newsgroups: comp.lang.c
From: michi@ptcburp.ptcbu.oz.au (Michael Henning)
Subject: Re: Question to test general C knowledge
Organization: Pyramid Technology Corporation
Date: Thu, 24 Dec 1992 00:01:18 GMT

kdq@quest.UUCP (Kevin D. Quitt) writes:

>mouse@thunder.mcrcim.mcgill.edu (der Mouse) writes:
>> sizeof(4["this is a test"])
>> must produce 1, or your compiler's broken.

>    Either that, or you've got 16-bit chars.


It doesn't matter how many bits you have in a char, sizeof(char) is always 1,
by definition (Section 3.3.3.4 of the ANSI C standard).

								Michi.
-- 
      -m------- Michael Henning                 +61 75 950255
    ---mmm----- Pyramid Technology              +61 75 722475 FAX
  -----mmmmm--- Research Park, Bond University  michi@ptcburp.ptcbu.oz.au
-------mmmmmmm- Gold Coast, Q 4229, AUSTRALIA   uunet!munnari!ptcburp.oz!michi
Newsgroups: comp.lang.c
From: bibhas@femto.engr.mun.ca (Bibhas Bhattacharya)
Subject: Re: strtok
Organization: Memorial University of Newfoundland
Distribution: usa
Date: Thu, 31 Dec 1992 21:12:56 GMT

tjhendry@mcs.drexel.edu (Jonathan Hendry) writes:

>Hi. Could someone please email me a brief description of how to use
>strtok()? I have read a few books, and asked my coworkers, and haven't
>received much useful information.

>Namely, after I run it on a string once, how do I get to the next
>part of the string?

It's worth noting that the string returned by strtok is not a fresh copy
but a part of the fragmented original string. Which means:
	- If you're going to refill the original string and want to use
	the returend string later, better make a copy of the returned
	string somewhere.
		gets(line);
		tok = strtok(line,":");
		gets(line); /*refill*/
		/*guess what? tok is not what you think it is, anymore*/

	- As strtok operates on a string it keeps on fragmenting it. If you want
	to do anything with original string again, you must keep a copy of it.

Bibhas.
--
	+==========================+=========================+
	| login name: DR. Jackyl   |  In real life: Mr. Hyde.|
	+==========================+=========================+
		          bibhas@pico.engr.mun.ca  
Newsgroups: comp.lang.objective-c
From: kelley@open.dal.ca (Dan Kelley)
Subject: what's in the GNU runtime library?
Summary: what's in the GNU runtime library?
Keywords: GNU objective-c
Organization: OPEN, Dalhousie University, Halifax, NS, Canada
Distribution: na
Date: Fri, 1 Jan 1993 01:01:44 GMT

A few days ago I, like lots of others, expressed the opinion that this
group would be a good place to post notes on the development of the
GNU objc program.

After watching lots of "yes" votes role in over the last few days, and
not a single "no" vote, I wonder if it's time for the GNU folks to
tell us what they have to say.  Can somebody please post a summary of
what's in the GNU runtime library?  (My texinfo document for gcc 2.3.3
doesn't seem to say much.)  In particular, might I expect the "Sample"
program from the FAQ to compile/run under the most recent gcc?

Thanks.




-- 
Dan Kelley, Oceanography Department   |  kelley@open.dal.ca
Dalhousie University                  |  {uunet watmath}!dalcs!kelley
Halifax, Nova Scotia, CANADA, B3H 4J1 |  (902) 494-1694
Newsgroups: comp.lang.objective-c
From: billb@nasty (Bill Burcham)
Subject: Re: GNU Objective-C discussion
Organization: First National Bank Of Chicago, Chicago IL, USA
Date: Tue, 29 Dec 92 15:03:07 GMT

Me too!  Me Too!
--
+--------------------------------+----------------------------------+
|          Bill Burcham          | "Make no small plans; they have  |
| First National Bank of Chicago | no magic to stir men's souls"    |
|    billb@fnbc.com  (NeXTmail)  |      Daniel J. Burnham           |
+--------------------------------+----------------------------------+
Newsgroups: comp.lang.objective-c
From: crath@bnr.ca (Christopher Rath)
Subject: Re: GNU Objective-C discussion
Organization: Bell Northern Research, Ottawa, Canada
Date: Mon, 28 Dec 1992 19:04:40 GMT

I would like to see the GNU Objective C work discussed here.

Christopher
--
 Christopher Rath   | crath@bnr.ca
 BNR Lab 5          |
 Ottawa, ON, Canada | "Hydrogen is a colourless, odourless gas which, given 
 (613) 765-3141     | enough time, turns into people." -- Henry Hiebert
Newsgroups: comp.lang.objective-c
From: sapp@falcon.ssc.gov (Kevin Sapp)
Subject: GNU Runtime
Originator: sapp@sawdust.ssc.gov
Organization: Superconducting Super Collider Laboratory, Dallas
Date: Tue, 29 Dec 1992 17:09:18 GMT

Greetings,

I am trying to persuade some folks here that using objective-c could have
some major advantages over C++, especially in the runtime access of 
variable names, types, method names, types, structure/class encoding, RUN
TIME BINDING.

I know that the NeXT runtime supports the above, does/will the GNU runtime?
I am working on structure inflating/deflating ala @encode for transfering
atructures/objects/variables to/from files/sockets...  I have the atomics,
strings, pointers, and arrays for deflating but not embedded objects.  The
code both works and needs some work.  The Inflation is not implemented yet.
(Has anyone done this?)

I am also trying to put together a FIRST CLASS object that can be queried
(using standard objective-c syntax) about itself...how many instance variables
do you have, what is the name of the 2nd one, type of 2nd one, ...
This would be the base class of a remote object (with some additional 
methods).  The current Class uses the NeXT runtime calls and structures
to obtain this information.  (What is the GNU way?)

I beleive these are the first steps toward distributed/remote objects.
(any thoughts?)  Once one can access an objects instance variable, class,
and method information at runtime the information is there now the transfer
of this data (ala @encode strings for processor independance), method 
existance, invocation and return values are some of the remaining challanges.

Civilized input welcome!  


-- 
----------------------------------------------------------------------------
Kevin A. Sapp                    "A civilization depends upon the quality
Superconducting Super Collider    of individual it creates"   (Dune)
sapp@sawdust.ssc.gov :>( please NO NeXT mail                   
Newsgroups: comp.lang.objective-c
From: dglattin@trirex.com (Dennis Glatting)
Subject: Re: GNU Objective-C discussion
Organization: Trirex Systems Inc.
Date: Wed, 30 Dec 1992 04:49:51 GMT

In article <BzzDzB.4Ky@cs.dal.ca> kelley@cs.dal.ca (Dan Kelley) writes:
> |> Richard Stallman believes it is too early to start a gnu-objc
> |> newsgroup.  So I wonder if this group, comp.lang.objective-c, would
> |> tolerate general discussion of GNU Objective-C.
> 
> Speaking as a 'reader', not a 'writer' to this group, I'd have to say
> PLEASE do post gnu stuff here.  I've been tantalized by the discussion
> of obj-c, but we don't have a compiler here that handles it.
> 
> Although we have gcc-1.37.1 and gcc2.2.2, when I try to compile the  
sample
> program from the FAQ, it dies because it cannot locate objc/Object.h.   
I've heard
> that the present gnuC doesn't have proper runtime libraries, so I wonder  
whether
> this is the problem, or is it just that our gcc isn't installed  
properly?  To put
> it simply, might a presently-available version of gcc be able to compile  
the
> program called 'sample' from the FAQ stored on music.sie.arizona.edu?   
If so,
> I'd be interested in trying it out.
> 

I can't speak for the example in the FAQ but there is a sleazy test suite  
available for the current GNU run time -- yes, the run time does exist, it  
is available, and it does work, but it is in its infancy.

Cruising through my file store...   Yes, there is a objc/Object.h.   
However, I'm using gcc 2.3.2 and I had to install the include files and  
libraries by hand.

I've just looked at the example in the FAQ.  Where do these objects come  
from?
#import "Queue.h"
#import "Stack.h"

--
Dennis P. Glatting / Sr. Technical Manager / Trirex Systems Inc.
315 Post Road West / Westport, Connecticut 06880 / (203)221-4600
dennis_glatting@trirex.com (NeXTmail Ok)
Member League for Programming Freedom
Newsgroups: comp.lang.objective-c
From: UC512052@mizzou1.missouri.edu (David K. Drum)
Subject: Re: GNU Objective-C discussion
Organization: University of Missouri
Date: Wed, 30 Dec 1992 01:11:48 GMT
X-Posted-From: mizzou1.missouri.edu
NNTP-Posting-Host: sol.ctr.columbia.edu

Absolutely, positively YES.
 
Regards,
 
David K. Drum uc512052@mizzou1.missouri.edu
From: uniteq@netcom.com (Uniteq Application Systems)
Newsgroups: comp.lang.objective-c
Subject: Re: GNU Objective-C discussion
Date: 29 Dec 92 06:00:52 GMT
Organization: Uniteq Application Systems

Also as a reader, I would very much like to hear about GNU Objective-C
development here (or on another bboard). I no longer have access to NeXT
machines and would rather like to do my recreational programming in ObjC.

		- Jeff.
Newsgroups: comp.lang.objective-c
From: garylang@netcom.com (Gary Lang)
Subject: Re: GNU Objective-C discussion
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
Date: Tue, 29 Dec 1992 04:29:16 GMT

"Speaking as a 'reader', not a 'writer' to this group, I'd have to say
PLEASE do post gnu stuff here.  I've been tantalized by the discussion
of obj-c, but we don't have a compiler here that handles it."

Since not much seems to happen here, I for one would find this a
welcome thing. Post away. 

-g
From: oscar@msen.com (Oscar Linares)
Newsgroups: comp.lang.objective-c
Subject: RE: GNU OBJ-C Discussion
Date: 30 Dec 1992 06:56:44 GMT
Organization: Msen, Inc. -- Ann Arbor, Michigan
NNTP-Posting-Host: garnet.msen.com
X-Newsreader: TIN [version 1.1 PL8]


I certainly would like to see the GNU Objective-C project discussed here.

Oscar A. Linares, M.D.
Laboratory of Mathematics and Computers
 In Biomedical Applications
1462 Sherwood Court
Dearborn, MI 48126
Newsgroups: comp.lang.objective-c
Subject: Re:similar instance method names,THANKS
From: raothall@iienext1.cim.eas.asu.edu (Karthic V. Rao-Thallikar)
Date: 21 Dec 92 17:32:03 GMT
Distribution: comp.lang.objective-c
Organization: Arizona State University

Thanks to all persons who replied to my request for help. I spent a lot of  
time before i posted it. I thought that there must be some method to  
implement methods with same names but different arguments. 
I appreciate everybody who replied to me.
Thank you all
Karthic
Newsgroups: comp.lang.objective-c
From: kelley@cs.dal.ca (Dan Kelley)
Subject: Re: GNU Objective-C discussion
Organization: OPEN, Dalhousie University, Halifax, NS, Canada
Date: Mon, 28 Dec 1992 17:59:34 GMT

|> Richard Stallman believes it is too early to start a gnu-objc
|> newsgroup.  So I wonder if this group, comp.lang.objective-c, would
|> tolerate general discussion of GNU Objective-C.

Speaking as a 'reader', not a 'writer' to this group, I'd have to say
PLEASE do post gnu stuff here.  I've been tantalized by the discussion
of obj-c, but we don't have a compiler here that handles it.

Although we have gcc-1.37.1 and gcc2.2.2, when I try to compile the sample
program from the FAQ, it dies because it cannot locate objc/Object.h.  I've heard
that the present gnuC doesn't have proper runtime libraries, so I wonder whether
this is the problem, or is it just that our gcc isn't installed properly?  To put
it simply, might a presently-available version of gcc be able to compile the
program called 'sample' from the FAQ stored on music.sie.arizona.edu?  If so,
I'd be interested in trying it out.

-- 
Dan Kelley, Oceanography Department   |  kelley@open.dal.ca
Dalhousie University                  |  {uunet watmath}!dalcs!kelley
Halifax, Nova Scotia, CANADA, B3H 4J1 |  (902) 494-1694
Newsgroups: comp.lang.objective-c
From: gsk@world.std.com (Geoffrey S Knauth)
Subject: GNU Objective-C discussion
Organization: The World Public Access UNIX, Brookline, MA
Date: Mon, 28 Dec 1992 09:12:10 GMT

Up until now, the GNU Objective-C discussion has been carried out on
the mailing list gnu-objc@prep.ai.mit.edu.  The problem is, there's
been more talk than coding, and now this must change.  GNU has an
embryonic run-time library which needs to be fleshed out.

Richard Stallman believes it is too early to start a gnu-objc
newsgroup.  So I wonder if this group, comp.lang.objective-c, would
tolerate general discussion of GNU Objective-C.

A related idea is that if I spend less time administering a discussion
list like gnu-objc, perhaps handing the list at `prep' over to someone
else, then I can spend more time on active development.  If anyone
would like to take over list administration, please contact me via
gsk@marble.com, or Richard Stallman <rms@gnu.ai.mit.edu>.
-- 
Geoffrey S. Knauth, Marble Associates, Inc.                Member BCS-NeXT, LPF
gsk@marble.com, (617) 891-5555 work, (617) 547-5247 home   Standard Disclaimers
From: scheurer@lithnext.epfl.ch (Marco Scheurer)
Newsgroups: comp.lang.objective-c
Subject: Re: GNU Objective-C discussion
Date: 29 Dec 92 10:20:11 GMT
Reply-To: scheurer@lithnext.epfl.ch

Yes! I m in favor of having the GNU Objective-C project discussed here.
---
Marco Scheurer	scheurer@lithnext.epfl.ch (NeXTMail)
Laboratoire d'Informatique Theorique
Ecole Polytechnique Federale de Lausanne
IN-Ecublens
CH-1015 Lausanne (Switzerland)
(+41) 21 693-2589
Newsgroups: comp.lang.objective-c
Subject: Re: problem with similar instance method names
From: tuncay <TOZNAL@MIAMIU.BITNET>
Date: Monday, 21 Dec 1992 15:44:09 EST
Distribution: comp.lang.objective-c
Organization: Miami University - Academic Computer Service

hi,
In article <1992Dec18.183133.6855@ennews.eas.asu.edu>,
raothall@iienext1.cim.eas.asu.edu (Karthic V. Rao-Thallikar) says:
>

I ran into the same problem with compiling the same program on the NeXT
platform.  My advisor solved the problem by:first including the header files of
the classes istead of .m files, then, compiling the .m files all together.

cc -ObjC Integer.m Float.m Fraction.m theMain.m
rm
>To all Objective-C Guru's:
>I am starting to write code in ObjecC. I am familiar with 'C'.
>My understanding of OOP is that if there are two similar classes eg
>Integer and Float the user can have the facility of using similarly named
>instance methods to operate on these classes. Just to try this out i coded
>the following lines. But the compiler reports errors for the 'initialize'
>and 'incrementBy' methods, and used the method defined for the Integer
>Class.
>Please do reply the correct procedure.
>I am using NeXt 3.0, and NeXt's ObjectiveC version that comes with the 3.0
>version.
>Thank you all in advance.
>Following is the code.
>They are in different file but I have 'cat' them for convinience.
>The error from the compiler is appended at the end for reference.
>
>//Test program  for late bindind
>#import "Integer.m"
>#import "Float.m"

Here, import the header files: Integer.h, Float.h and Fraction.h

>#import "Fraction.m"
>#import <stdio.h>
>
>errors are:

>> cc test.m

you have to use -ObjC option when you compile Objective C code in the NeXT
platform, as far as I know.  Use the following command:

    cc -ObjC Integer.m Float.m Fraction.m test.m -o test

>Float.m: In method `new:'
>In file included from test.m:4:
>Float.m:8: warning: multiple declarations for method `initialize:'
>Integer.h:11: using `-initialize:(int)anInt'
>Float.h:10: also found `-initialize:(float)aValue'
>Float.m: In method `incrementBy:'
>Float.m:20: conflicting types for `-incrementBy:(float)aValue'
>Float.h:12: previous declaration of `-incrementBy:(int)aValue'
>test.m: In function `main':
>test.m:46: warning: multiple declarations for method `incrementBy:'
>Integer.h:13: using `-incrementBy:(int)aValue'
>Float.m:20: also found `-incrementBy:(float)aValue'
>>
The above two changes should fix the problem.  I like PINSON/WIENER'S book
a lot despite the fact that I could not work some of their code on
the machine that I use. It is a NeXT, too.

Have fun.
Xref: sparky comp.lang.objective-c:699 comp.windows.misc:1744 comp.sys.next.programmer:7918
From: johnu@syma.sussex.ac.uk (John E. Upham)
Subject: HPGL to PS conversion program ?
Keywords: HPGL, ps
Organization: University of Sussex
Date: Sun, 20 Dec 1992 21:22:38 GMT


Dear All,
        Are there programs availabel to convert from HPGL format to
.ps for PC, SGI and Sun hardware platforms ?


Thanks for any help.


 john upham

-- 
John Upham, Dept. of Chemistry, University of Reading, Berks., RG6 2AD, UK.
Email: scsupham%susssys1.rdg.ac.uk@uk.ac (BITnet), scsupham@rdg.susssys1 (Janet)
Voice:   +44 734 875123 x7441 (day), Fax: +44 734 311610