473,418 Members | 2,119 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

Requesting advice how to clean up C code for validating string represents integer

I'm working on examples of programming in several languages, all
(except PHP) running under CGI so that I can show both the source
files and the actually running of the examples online. The first
set of examples, after decoding the HTML FORM contents, merely
verifies the text within a field to make sure it is a valid
representation of an integer, without any junk thrown in, i.e. it
must satisfy the regular expression: ^ *[-+]?[0-9]+ *$

If the contents of the field are wrong I want to diagnose as much
as reasonable what's wrong, not just say "syntax error".

Because perl and PHP include support for regular expressions, it
was obvious how to do it, and easy to accomplish:
http://www.rawbw.com/~rem/HelloPlus/...html#h4intperl
http://www.rawbw.com/~rem/HelloPlus/....html#h4intphp

Because Common Lisp has good utilities for scanning strings, mostly
using position, position-if, and position-if-not, it was equally
easy, and equally obvious, how to do it:
http://www.rawbw.com/~rem/HelloPlus/...html#h4intlisp

The Java API is missing some of the functions available in Common
Lisp, so I had to augment the API, but then it was as easy as in
Common Lisp, with nearly the same algorithm:
http://www.rawbw.com/~rem/HelloPlus/...html#h4intjava

Now we come to C: I presently have a horrible mess:
http://www.rawbw.com/~rem/HelloPlus/...4s.html#h4intc
I'm thinking of pulling out all the character-case testing into a
function that converts a character into a class-number (such as 1
for space, 2 for digit, 3 for sign, etc.), calling that all over
the place, and the using a SELECT statement on the result, which
won't change the logic of the code but might make it tidier.
Alternately I might hand-code replacements for the Lisp/Java
utilities for scanning strings, or find something in one of the C
libraries that would help, and then translate the Lisp or Java code
to C. Do any of you have any other ideas what I might do to clean
up the C code? Don't write my code for me, but just give hints what
library routines might do 90% of the work for me, or suggest
re-design of the algorithm? One thing I don't want to do is
download a REGEX package for C. I'm trying to give examples of how
to do things from scratch in C, not how to simply use somebody
else's program, even if the source for the REGEX module is
available. If something isn't in the a standard library for C, then
it doesn't exist for the purpose of this project. (The only
exception I made is the module for collecting and decoding HTML
FORM contents, which is a prerequisite for this whole project.)
Feb 11 '07
232 13053
re*****@yahoo.com (Robert Maas, see http://tinyurl.com/uh3t) writes:
>From: Keith Thompson <k...@mib.org>
You're seriously messing up the attributions. Your news client
should handle this for you.

I don't know why you would think such a thing.
[details snipped]

Ok, I don't know why your attribution lines are messed up, and I don't
know what you need to do to fix them. Please figure it out. Look at
the other articles in this newsgroup for examples of what attribution
lines *should* look like.

[...]
>some software inserts a '>' character in front of the word "From"
at the beginning of a line.

Well, there's a keyboard driver on my Macintosh which detects that
I've pressed those two keys, then a callback routine
[...]

No, that's not what I'm talking about.

Lines starting with "From " are used as a delimiter in e-mail files.
If you happen to have a line in the middle of a message starting with
"From ", some e-mail and news software will insert a "or "" prefix
so it doesn't appear to be the start of a new message. I was guessing
that that might be why your attribution lines look the way they do.

Again, look at the attribution lines in other articles, and find a way
to make yours look like them.

[...]
>An "lvalue", in the sense that Chris is using the word (which is
not the way the C standard defines it) is a value to which you can
assign.

That makes no sense at all. A value is the thing assigned, not the
variable that gets assigned to.
Let me emphasize again that Chris is using the term "lvalue" in its
original sense, which is not the sense in which it's used by the C
standard.

It does make sense, whether you understand it or not. You just need
to expand your concept of what a "value" can be.

[...]
Now for stack-allocated simple variables, the machine instruction
is a fixed-offset relative to the stack pointer as an index
register, so in that sense I suppose you could say machine address
calculation (add compiled constant offset to current value of stack
pointer) is done at runtime. Is that what you were babbling about??
So the so-called 'lvalue' is really what in machine language jargon
is called the "effective address". Maybe we should convince the
ISO committee working on C2009 to use that term??
I was not babbling about anything. Yes, I think an "effective
address" is similar to the concept of "lvalue" as Chris is using the
term.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 20 '07 #151
Date: Sun, 25 Feb 2007 05:16:47 +0000
From: Flash Gordon <s...@flash-gordon.me.uk>
You have not fixed all of the errors that have been pointed out to you.
I claim to have fixed all the errors which were to my knowledge
pointed out to me prior to the date of your article (Feb.25). I
have a huge backlog of more recent articles bookmarked but not yet
processed:
Message-ID: <8b************@news.flash-gordon.me.uk>
Message-ID: <ur************@news.flash-gordon.me.uk>
Message-ID: <m6dEh.194$Rf7.157@trnddc02>
Message-ID: <no************@news.flash-gordon.me.uk>
Message-ID: <er**********@murdoch.hpl.hp.com>
Message-ID: <er*********@murdoch.hpl.hp.com>
Message-ID: <11**********************@z35g2000cwz.googlegroups .com>
Message-ID: <es*********@enews1.newsguy.com>
Message-ID: <6n********************************@4ax.com>
(treehouses safe?)
Message-ID: <d2********************************@4ax.com>
(also Chinese factor: to put water on boombox!!)
Message-ID: <03************************@removethis.got.net>
Message-ID: <er**********@reader01.news.esat.net>
Message-ID: <1i********************************@4ax.com>
Message-ID: <er**********@reader01.news.esat.net>
(my mother's step-father)
Message-ID: <er**********@reader01.news.esat.net>
Message-ID: <11**********************@q2g2000cwa.googlegroups. com>
Message-ID: <er**********@reader01.news.esat.net>
(neither eating is essential)
Message-ID: <er*********@reader01.news.esat.net>
Message-ID: <02***************@bignews1.bellsouth.net>
(I'm a nice guy who has suffered from shyness most of my life, ...
Message-ID: <c4******************************@rcn.net>
("ya" is a Spanish-language word. Do you know what it means?)
Message-ID: <dW****************@bignews1.bellsouth.net>
(I think that's a great idea!)
Message-ID: <11********************@v33g2000cwv.googlegroups.c om>
(Hey, I did cybersex once, in late 2000, with dead2u. ...
Message-ID: <11*********************@30g2000cwc.googlegroups.c om>
Message-ID: <12*************@corp.supernews.com>
(under Stevens Creek freeway along Evelyn next to creek with ...
Message-ID: <11**********************@p10g2000cwp.googlegroups .com>
Message-ID: <er*******************@news.demon.co.uk>
Message-ID: <u7********************************@4ax.com>
Message-ID: <45***********************@authen.yellow.readfreen ews.net>
(If you keep a copy of your sent-mail, the address is there to copy&paste later.)
Message-ID: <45***********************@authen.yellow.readfreen ews.net>
Message-ID: <12*************@corp.supernews.com>
Message-ID: <45***********************@roadrunner.com>
(what was the IP number where it came from?)
Message-ID: <x9*********************@bt.com>
Message-ID: <20****************************@eircom.net>
Message-ID: <ln************@nuthaus.mib.org>
(hey, I was thinking I might be the only one left)
Message-ID: <20*********************@tania.servebbs.org>
Message-ID: <20*********************@tania.servebbs.org>
Message-ID: <bg***************@nospam.invalid>
Message-ID: <45***********@mindspring.com>
Message-ID: <45********@news.peopletelecom.com.au>
Message-ID: <6p************@news.flash-gordon.me.uk>
Message-ID: <c8********************************@4ax.com>
Message-ID: <ln************@nuthaus.mib.org>
Message-ID: <45***********************@authen.yellow.readfreen ews.net>
Message-ID: <rL*********************@bt.com>
Message-ID: <ln************@nuthaus.mib.org>
(looked at man pages for that)
Message-ID: <45***********************@free.teranews.com>
(No manual entry for func)
Message-ID: <11*********************@o5g2000hsb.googlegroups.c om>
(which "Anna"?)
Message-ID: <11**********************@d57g2000hsg.googlegroups .com>
(e-mail, mars)
If my mistake (in my CookBook/Matrix) is noted in any of those
bookmarked articles, I'll be getting to them any day now... But if
it's in some earlier article, either I didn't happen to see it
(Google Groups currently provides no reasonable way to find all
followups to what I previously posted, it's hit-and-miss whether
I'll chance to see some particular followup), or I saw it but
dismissed it as too vague to understand.

If you know of any article pointing out a mistake (in my
CookBook/Matrix) which is not yet corrected and not in that list of
bookmarks, please cite a line or two of text at the point of the
note-of-mistake, so that I can use Google Groups to find the full
article then use those 1-2 lines of text to find the specific place
within that article where the note-of-mistake appears.

If you want, I can issue a quick preliminary ACK as soon as I
see-and-bookmark your article, so you'll know I saw it. If I don't
see it within a couple days after you post it, I might never see
it, like I said due to no reasonable way to find all followups, so
you might then need to connect to my Web site and send me a instant
alert telling me the message-id of the article I see to have
missed. The quick-preliminary-ACK would be via the newsgroup of
course, and you might not see it. If you have a Web site with a
simple means to send you an instant alert, let me know the URL for
instructions how to do that, and I'll give it a try.

Actually, for something so short as just telling me two lines of
text in a note-of-mistake article I somehow overlooked, you might
just tell me in an instant alert in the first place, instead of
posting to a newsgroup and hoping I happen to find it, your choice
which contact method to try.

Not yet implemented, but hot on my mind: I might someday soon
finally implement CGI-SMTP. The server would run as a CGI
application, but would accept SMTP commands (all in one batch
instead of piecemeal-interactive), then it would process all the
commands in sequence and return a corresponding sequence of
responses. (Of course the server can do lookahead if it wants,
giving it an advantage over regular SMTP in blocking spam, such as
issuing a rejection of the RCPT TO command because the subsequent
message body is unacceptable for that recipient.) The client would
then interleave the saved original sequence of commands with the
returned sequence of responses and then act as if it had been a
regular SMTP interchange all along. If I implemented that, would
you use it to contact me directly in matters like errata in my
CookBook/Matrix?
The only was [sic] to get people to fully review it is to fix the
problems already pointed out and then ask for further review.
That's reasonable, except that I'm not aware of any outstanding
already-pointed-out problems, except what might be within the more
recent articles in that bookmark list. I'm going to make a mad dash
to try to catch up with my backlog. Stand by...

Regarding a possible sub-title to my CookBook/Matrix:
Adding, "written by someone inexperienced in C and other
languages" might help.
Not quite that, but maybe something like "this is a working
document, to try to gather together all the relevant information
about how to do the same set of tasks in up to six different
programming languages if possible, and to describe those
task-accomplishing methods (*) clearly/succinctly/unambiguously,
which is a learning experience for both the author and any early
proofreaders (both expert and newbie) that might turn up".

* ("method" used in the general sense, a way to accomplish
something, not in the OOP/Java/C++/CLOS sense)
Mar 20 '07 #152
Robert Maas, see http://tinyurl.com/uh3t wrote, On 20/03/07 09:18:
>From: Flash Gordon <s...@flash-gordon.me.uk>
>>Unfortunately
without access to the 1999 standard, this decision will be
difficult to implement.
(which was true at the time I wrote it)
>It's a good job you have access to it then, isn't it.

At the time you wrote that, I didn't yet have access. But as soon
as I saw your article the next day or so, things might have
changed. Let me check...
Links have been posted in replies to your messages before, so if you do
not have access it is because YOU have chosen not to have access.
>If no one has given you the details before, then go here
http://www.clc-wiki.net/wiki/c_standard and follow the links.

That WebPage doesn't have a links section, however when I first saw
Not one section, but lots of links including in the section you mention
below.
your article, before I had time to post nor time to read the Web
pages linked, I did manage to find these two links that might be
useful, from somewhere in the Wiki page, I have no idea where,
although if I search for the Linkname text I might find them again:

Linkname: c standard - clc-wiki
URL: http://www.clc-wiki.net/wiki/c_stand...g_the_Standard
Hmm, I seem to have bookmarked a section in that same Wiki page.
It says:
Neither the Standard nor its amendments are available free of charge,
I think that kills the issue for me.
Then you are either incapable of reading more than one sentence, too
lazy to bother reading more than one sentence, too stupid to read more
than one sentence, or trolling. Since the very next sentence tells you
that you can get what you want.

<snip>
>According to that statement and your web page that means you do not
understand C. Your cookbook still has this prototype given in what is
meant to be C "int g2(int n1,n2);" despite it having been pointed out to
you and you having read the post and commented about it.

I don't recall either the critique of that nor my response.
Checking Google I see indeed somebody said something was wrong with
that but didn't say what was wrong, so I asked for clarification,
but nobody ever answered, so I still don't know what was supposed
to be wrong, nor even whether there is anything wrong in the first
place or you are just <cliche>pulling my leg</cliche>.
If you cannot be bothered to put it through a compiler or read any
vaguely correct resources that is your problem.

<snip>
>>For example, buffer overflow is natural with pointer arithmetic,
all you need is a teensy programmer bug overlooked admist the
kilometers of source code that needs eyeballing to find anything,
but buffer overflow is impossible in Java or Common Lisp.
I've never had to go back over all of any significantly complex program
I've written.

Hey, does the Pope know about you? He's always looking for another
good candidate for Sainthood, and if you have never made a mistake
in your whole life then I think he should seriously consider you,
even if you're not Catholic, after all Jesus wasn't Catholic
either, and the Church rates him even better than a saint.
I never said I was perfect nor that I never have to fix bugs, just that
I never have to go back over all of the program. If I did I would
probably still be on my first C program since that was certainly in the
10s of thousands of lines of C. Obviously I had written a lot of code in
other languages before I started C!
>>Is 20% speed gain really more important than security?
>Depends. Do you want to crash in to the car in front because your
breaks did not apply in time? There are times when speed (or
consistency of speed) is just as important a requirement as any
other.

Anybody who would design a passenger vehicle with the only path
between brake pedal and brake pads being through a complicated
computer program would IMO be a fool.
Stay off aircraft and away from flight paths then, since a lot of
aircraft are fly-by-wire (i.e. controlled by computers) then. Have you
been asleep for the past decade?

<snip>
>There are far too many misconceptions in your web pages, such as
being able to compare unrelated pointers, ...

So long as the pointers are of the same type, there's nothing
impossible with comparing them, which will tell you whether the
objects pointed-at are this way or the opposite with respect to
each other in memory. If you think a program is not able to compare
the pointers, please explain your reasoning.
You show your ignorance and the fact you don't bother to read again. It
has been stated many times in the past that comparing pointers that do
not point in to the same object (or 1 past the end) for anything other
than equality invokes undefined behaviour. It needs no more reason than
the standard state it.

<snip rubbish>
>right shifting a negative number 0 fills

It depends on whether you are talking about arithetic shift or
logical shift.
C does not have "arithmetic shifts" and "logical shifts" it only has
shifts which do not necessarily zero fill..
Can you cite the paragraph where I said something
confusing to that point?
Yes, just above here.
>* being for dynamically allocated objects only, [] being for
"static-allocated" objects only.

I'm sure I never said any such thing. You're misreading, or lying.
I doubt I would have said you said it if you did not, but I'm not going
to bother re-reading your pages until there has been some indication
that you have actually learned something. After all I tend to only
bookmark things which might be either useful or interesting, your web
site is neither.
--
Flash Gordon
Mar 20 '07 #153
From: Flash Gordon <s...@flash-gordon.me.uk>
Anyway, of course there is lot of system-specific functions
which do lot of good. Do you not agree this guy should not
put those in his cooksomething?
I'd still be interesting to see *vast* number of functions
like that which do something of interest in that cookthing.
Functions for networking (getting MACs for NICs is very useful
but IIRC you need to go beyond POSIX on nix boxes to do it),
I intend eventually to include networking (sockets, streams, etc.)
eventually after I finish the more basic stuff (and maybe some
stuff rather soon if I feel like it), and I already have stubs for
those future sections of my CookBook/Matrix:
<http://www.rawbw.com/~rem/HelloPlus/CookBook/Matrix.html>
Input/Output:
...
* [Local interprocess streams]
* [InterNet TCP streams]
* [InterNet datagrams]
<http://www.rawbw.com/~rem/HelloPlus/CookBook/ConPara.html>
Table of contents:
...
* [RPC (remote procedure call), RMI (remote method invocation)]

If POSIX is incompatible with all those topics, I may need to
include it in a separate chapter. Please let me know if in your
opinion that's the case.

To my knowledge, "NIC" means Network Information Center, such as
APNIC, JPNIC, KRNIC, etc. If you're using it to mean something
else, please explain.
functions for graphics,
I have no access to any computer where I would be able to test
graphics in even one of those six languages, much less in all six,
so I won't be including anything whatsoever about graphics in *my*
document. But if you would be willing to write your own chapter on
graphics in all six languages, multiple specific implementations on
multiple specific platforms (Unix/FreeBSD/Solaris/SunOS/etc.,
Linux/RedHat/etc., Mac System 6.0.x, Mac System 7.5.x, Mac System
10.x, and a whole slew of various MS-Windows versions
NT/2000/whatever), I'd be glad to give a cursory browse of it to
verify that it conforms to my basic CookBook/Matrix idea, then
include it virtually in my document as an external chapter-link.
functions for threads etc.
That's already planned, but only in a limited way, because while
it's built into the standard Java port, it's only a vendor-add-on
in the other languages so I'd be able to test it only in a very
limited way, basically only java version 1.2.2 and CMUCL version
18b, AFAIKATM. Hmm, I don't yet have a stub for that section,
adding it now ... done:
<http://www.rawbw.com/~rem/HelloPlus/CookBook/ConPara.html>
Table of contents:
...
* [multi-processing, threads]
If you volunteer to write sub-sections for threads on other
platforms, I'd be glad to link it in if it meets my standards.
If a "CookBook" is going to cover such things, which is not
unreasonable,
Agreed (with caveat that graphics isn't possible for me to
personally cover).
then it will need to cover system specifics.
Not for threads in java, and some other features in various
languages that are portable, but yes to completely cover any one of
those topics for all six languages will require system-specific
coverage for at least one of the languages. In the short run I'll
simply say that in such-and-such language there is no portable way
to accomplish the task, and describe how-to only for the few
languages where it *is* portable. Later, I haven't decided whether
to *ever* include the system-specific info.
Of course, it should clearly mark what is system specific.
Yes, agreed, if I ever include anything like that.

There's also the matter of standard-version-specific, such as
strtoll which is in C1999 but not C1990 (I'm fed up with being
non-y2k-safe in such jargon!! <OT>I'm getting shitloads of spam
that says it was sent in the year 37 or 38, which Yahoo! Mail
treats as if it were sent from the future year 2037 or 3038
respectively, when IMO Yahoo! Mail should blanket reject all such
grossly-mis-dated e-mail</OT>).
If you tell them it is only in the latest standard and they find
it is not in the latest and greatest from <insert provider of
dislikethen they will not only learn that provider as not kept
up but also what it is the provider is not doing.
I agree. Furthermore, if *every* function/operator/method per some
older standard *is* in that particular implementation, and it's
only the newly-standardized stuff that's not present, then the user
knows the company *was* up to date before the standard changed out
from under them, so they should be given some slack, like ten years
to finally finish upgrading their product for the new standard, so
give them two more years slack on the issue of C1999. On the other
hand, if not even the 17-year-old standard (C1989/C1990) is fully
implemented, it's seriously time to find a new vendor who respects
portability issues even a teensy bit.
Providing random information about system specific stuff is bad
for one set of reasons (although non-random clearly marked system
specifics is not). Sticking to C99 only is bad for different
reasons.
Agreed. I'm currently leaning toward treating all ten-or-more-year-old
standard as given fact, and flagging all within-past-ten-years
changes specially to alert users that even a good implementation
(such as GNU C) might not yet have all that new stuff.
This chap has given the impression that he is using some form of
remote system which he probably does not own or control.
That's correct. I use a commercial ISP which is running FreeBSD
Unix, and which is accessible from home only via VT100 dialup.
I have no control whatsoever, and extremely little influence, on
what man pages or upgrades to java etc. the admin chooses to
install or not. Witness only java 1.2.2 installed to date.
Even my laptop (that I got for free, with modem that died so I
can't produce any content there for upload) has java 1.3 something.
As for gcc, man pages don't tell any way to learn which version
number it is, so I have no idea which version I'm using.
Dear newbie reading this stuff and thinking I am right: no way,
forget and ignore all I say.
Is this better now?
Currently that warning belongs on Robert's site!
Not at all. I actually need eager newbies with lots of energy to
try various methods (*) I suggest in my CookBook/Matrix and tell me
whether some text was confusing or unacceptably incomplete or
outright wrong. My instant-alert Web service can be used to report
short errata, or to alert me that longer errata have been e-mailed
so I know to search for it among tes of thousands of spam it's
mixed with. (If you think looking for needle in haystack is hard!!)

* (not OOP sense, more general sense: operator/[generic]function/OOPmethod)

<meta>Hmm, I think in the future when I use the word "method" in
that original general sense, I'll just use SGML/XML markup:
<general>method</general>, and when I use the word in the OOP sense
I'll mark it <oop>method</oopinstead. Would that be clearly
understood by everyone here?</meta>
Mar 20 '07 #154
re*****@yahoo.com (Robert Maas, see http://tinyurl.com/uh3t) writes:
>Date: Sun, 25 Feb 2007 05:16:47 +0000
From: Flash Gordon <s...@flash-gordon.me.uk>
You have not fixed all of the errors that have been pointed out to you.

I claim to have fixed all the errors which were to my knowledge
pointed out to me prior to the date of your article (Feb.25). I
have a huge backlog of more recent articles bookmarked but not yet
processed:
Message-ID: <8b************@news.flash-gordon.me.uk>
[snip]
Message-ID: <11**********************@d57g2000hsg.googlegroups .com>
(e-mail, mars)
You've posted a list of 48 Message-IDs, but you didn't bother to post
the URL for your "CookBook/Matrix document". I haven't bothered to
bookmark it. If you want anyone to look at your document, tell us
where it is. It wouldn't hurt to mention the URL every time you post
about it.

I'm not saying that I'll look at it, but I certainly won't bother to
track it down if you make it difficult to find it.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 20 '07 #155
From: Flash Gordon <s...@flash-gordon.me.uk>
It is better to specify anything that is not C89 is not C89 and
what it actually is, be it C99, POSIX, MS, GNU or whatever. The
only standard fully implemented by most compilers is C89, in
particular gcc document that their C99 implementation is not
complete and MS VC++ does not even attempt it, and that covers the
bulk of new users who are not using something written before C99
was even published. So stick to C89 (not C99) as the base and then
specify things in C99 or whatever as appropriate and appropriately
documented.
That's my current wannado. Unfortuately while I've at long last been
able to find and download a text version of:
WG14/N869 Committee Draft -- January 18, 1999
I haven't yet found anything comparable for C1989-90, so even using
'grep' to test for mention in C1989-90 isn't yet feasible.
I would expect that if there are man pages installed then they
are infinitely better than what he is writing.
The 'man' pages here for gcc tell **only** how to run the program,
the many many switches to affect its behaviour, nothing whatsoever
about the grammar of the programming language which it accepts as
input. Perhaps you can suggest an appropriate 'man' page to try??
% man c90
No manual entry for c90
% man c89
Formatting page, please wait...
NAME
c89 -- POSIX.2 C language compiler
...
STANDARDS
The c89 command is believed to comply with IEEE Std 1003.2 (``POSIX.2'').
Nope, that's not what I need to find.
I was suggesting that he *should* read the bibliography and get
some of those books and read them.
Should I check if the Sunnyvale public library has any of them??
What's the chance of that?? <ot>A few months ago I looked for
Dawkin's "The God Delusion" and learned they have just one copy,
with about fifty people on the wait list for it.</ot>
1) I think we both agree that the OPs site currently has negative value
I'm considering putting you on my "hurt list", people who
deliberately say hurtful things to me but make no comparable effort
to ameliorate whatever is bothering them so much to provoke them to
make such statements. You'll be listed alongside the people who
accuse me of being a pedophile or child molestor, the writer for
the San Jose METRO newspaper who wrote a grossly dishonest and
demeaning article about me, and the social worker (Michele Dove)
who lied to the court to provoke it to take my children away
without due process and who also lied to the psychiatrist doing my
psychlogical evaluation to change his mind where he had said I'm
under stress but he sees no reason why I would be a danger to my
children, but after she lied and told the psychiatrist that I had
been found by the court to have abused my children **before** the
hearing where she was supposed to present her allegations and have
them considered, the psychiatrist added a section to the bottom of
his report that says considering that additional information that I
was already (FALSE!!!) found to have abused my children he
recommends the children be taken away, contrary to his opinion upon
conducting the original psychological evaluation, so when there was
supposed to be a hearing to determine what veracity if any there
was to her false allegations, the judge ruled summarily against me
and refused to give me the right to a trial with witnesses I can
cross-examine.
Mar 20 '07 #156
re*****@yahoo.com (Robert Maas, see http://tinyurl.com/uh3t) writes:
[...]
As for gcc, man pages don't tell any way to learn which version
number it is, so I have no idea which version I'm using.
<OT>
Look harder. "gcc --version".
</OT>

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 20 '07 #157
Keith Thompson wrote, On 20/03/07 21:36:
re*****@yahoo.com (Robert Maas, see http://tinyurl.com/uh3t) writes:
>>Date: Sun, 25 Feb 2007 05:16:47 +0000
From: Flash Gordon <s...@flash-gordon.me.uk>
You have not fixed all of the errors that have been pointed out to you.
I claim to have fixed all the errors which were to my knowledge
pointed out to me prior to the date of your article (Feb.25). I
have a huge backlog of more recent articles bookmarked but not yet
processed:
Message-ID: <8b************@news.flash-gordon.me.uk>
[snip]
>Message-ID: <11**********************@d57g2000hsg.googlegroups .com>
(e-mail, mars)

You've posted a list of 48 Message-IDs, but you didn't bother to post
the URL for your "CookBook/Matrix document". I haven't bothered to
bookmark it. If you want anyone to look at your document, tell us
where it is. It wouldn't hurt to mention the URL every time you post
about it.

I'm not saying that I'll look at it, but I certainly won't bother to
track it down if you make it difficult to find it.
Well, I looked since he posted a link to part of it else-thread. It
still has:
int g2(int n1,n2);
so he has not addressed all the comments. If he still can't be bothered
to try compiling the code and can't get something this basic correct I
still don't think it worth looking at. Well worth avoiding, and well
worth pointing out to any unsuspecting passers by how bad it is, but not
of use for anyone who wants to learn anything about C.
--
Flash Gordon
Mar 20 '07 #158
re*****@yahoo.com (Robert Maas, see http://tinyurl.com/uh3t) writes:
Flash Gordon <s...@flash-gordon.me.ukwrote:
[attribution line corrected]

[...]
>1) I think we both agree that the OPs site currently has negative value

I'm considering putting you on my "hurt list", people who
deliberately say hurtful things to me but make no comparable effort
to ameliorate whatever is bothering them so much to provoke them to
make such statements. You'll be listed alongside the people who
accuse me of being a pedophile or child molestor, the writer for
the San Jose METRO newspaper who wrote a grossly dishonest and
demeaning article about me, and the social worker (Michele Dove)
who lied to the court to provoke it to take my children away
without due process and who also lied to the psychiatrist doing my
psychlogical evaluation to change his mind where he had said I'm
under stress but he sees no reason why I would be a danger to my
children, but after she lied and told the psychiatrist that I had
been found by the court to have abused my children **before** the
hearing where she was supposed to present her allegations and have
them considered, the psychiatrist added a section to the bottom of
his report that says considering that additional information that I
was already (FALSE!!!) found to have abused my children he
recommends the children be taken away, contrary to his opinion upon
conducting the original psychological evaluation, so when there was
supposed to be a hearing to determine what veracity if any there
was to her false allegations, the judge ruled summarily against me
and refused to give me the right to a trial with witnesses I can
cross-examine.
Ok, I'm going to give this one last try.

Imagine an open classroom on, say, a college campus. This particular
classroom is dedicated to discussions of the C programming language.
Everyone is free to drop in and join the discussion, and there's
plenty of room. After a while, there's even a sense of community.

I walk in, sit down, and start asking and answering questions. But
they some guy comes in, sits down next to me, and insists on spending
class time talking about his personal problems and complaining about
the general lack of sympathy.

This is a problem, and everyone starts nervously moving away from this
guy. It's not that we're unsympathetic to his problems; he's just
choosing a poor and disruptive way of dealing with them. And there
are other classrooms (hint: newsgroups) where I'm sure they'd be glad
to hear about his personal situation and do whatever they can to help.
But this classroom is for discussion of C, and even if we wanted to
spend class time helping him, we just don't have the expertise or
ability to do so. And the problem is, he *also* talks about C, which
makes some of us hesitant to ignore him, but eventually enough is
enough.

The analogy isn't perfect. comp.lang.c isn't a classroom, and nobody
can really monopolize our time. We can't, and don't necessarily want
to, prevent you from posting. But we can easily ignore you. We can
even automate the process of ignoring you by using a killfile. I
suspect a number of people here have already done so.

I truly wish you the best of luck with your personal situation, but
this is not the place to discuss it. If you want to discuss C, you're
welcome here; if not, I wish you luck in finding a more appropriate
forum.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 20 '07 #159
"Robert Maas, see http://tinyurl.com/uh3t" wrote:
>From: "santosh" <santosh....@gmail.com>
.... snip ...
>
>CBFalconer has a pure text version of the final C99 draft at:
<http://cbfalconer.home.att.net/download/n869_txt.bz2>

Sorry, I read only English. When I copy&paste that URL into the
Web browser (lynx) and fetch the Web page, I see something that
ain't English:
It's compressed. You download it and expand it with bzip2. Did
you never hear of compression? It saves (in this case) about 80%
of the transfer time.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

--
Posted via a free Usenet account from http://www.teranews.com

Mar 21 '07 #160
"Robert Maas, see http://tinyurl.com/uh3t" wrote:
>From: Yevgen Muntyan <muntyan.removet...@tamu.edu>
>You didn't notice warm feelings from many people here to you?

That's correct, not any warm feelings whatsoever apparent here.
If somebody meant to convey warm feelings toward me, said person
utterly failed at said conveyance.
Maybe you should consider the possibility that the reaction is
connected with your own posts? Or that the c.l.c. universe
consists entirely of unfeeling clods, whose prime purpose in life
is to distribute demeaning comments?

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

--
Posted via a free Usenet account from http://www.teranews.com

Mar 21 '07 #161
Robert Maas, see http://tinyurl.com/uh3t wrote, On 20/03/07 22:00:
>From: Flash Gordon <s...@flash-gordon.me.uk>
It is better to specify anything that is not C89 is not C89 and
what it actually is, be it C99, POSIX, MS, GNU or whatever. The
only standard fully implemented by most compilers is C89, in
particular gcc document that their C99 implementation is not
complete and MS VC++ does not even attempt it, and that covers the
bulk of new users who are not using something written before C99
was even published. So stick to C89 (not C99) as the base and then
specify things in C99 or whatever as appropriate and appropriately
documented.

That's my current wannado. Unfortuately while I've at long last been
able to find and download a text version of:
WG14/N869 Committee Draft -- January 18, 1999
I haven't yet found anything comparable for C1989-90, so even using
'grep' to test for mention in C1989-90 isn't yet feasible.
You've been given references to where there is a link to the last draft
of the C89 standard before. Admittedly the actual link to the C89 draft
was broken until a short time ago, but you obviously never bothered
trying it or you would have reported it. If you read you will find a now
working link to it at http://clc-wiki.net/wiki/The_C_Standard
>I would expect that if there are man pages installed then they
are infinitely better than what he is writing.

The 'man' pages here for gcc tell **only** how to run the program,
<snip>
Nope, that's not what I need to find.
As I know has been mentioned before, "man func". E.g. "man fread".
>I was suggesting that he *should* read the bibliography and get
some of those books and read them.

Should I check if the Sunnyvale public library has any of them??
What's the chance of that?? <ot>A few months ago I looked for
Dawkin's "The God Delusion" and learned they have just one copy,
with about fifty people on the wait list for it.</ot>
If you can't be bothered to check it is your own fault that you do not
have access to a decent book.
>1) I think we both agree that the OPs site currently has negative value

I'm considering putting you on my "hurt list", people who
deliberately say hurtful things to me but make no comparable effort
to ameliorate whatever is bothering them so much to provoke them to
make such statements.
Do you think that actually bothers me? You have repeatedly failed to
take advice and correct errors. Your site still contains at least one
basic error that I have pointed out to you, and if you can't fix it from
just knowing the line is in error you *definitely* don't know enough
about C to be writing anything about it and should take the site down
and start reading a decent text book or tutorial and not publish any
reference material until you actually know the language. Currently your
site has negative value because it is such poor quality that the only
people who will "learn" anything from it will not realise how bad it is
and so what they learn will be incorrect.

To write something with either zero or positive value requires at a
minimum a very good knowledge of the subject material AND skill at
writing reference material or tutorials, not many people have both.
You'll be listed alongside the people who
accuse me of being a pedophile or child molestor, the writer for
the San Jose METRO newspaper who wrote a grossly dishonest and
<snip rant about everyone being out to get Robert Maas>

What do you think any of that lot has to do with this group? Perhaps
somewhere in alt.support.* would be a better place for you to discus
that lot.
--
Flash Gordon
Mar 21 '07 #162
From: Chris Dollin <chris.dol...@hp.com>
There are only values, so if assignment assigns to something, it
must be a value.
A value cannot exist unless it exists somewhere. There's no such
thing as just existing without being anywhere. The location where a
value exists is not itself a value, it's a place, a.k.a. location.
Consequently, if there are values, then there are also places,
which are two distinct types.

At the abstract level there are also equivalance classes of values.
Given any equivalence relation on values, such as bitwise and
structural identity, there are equivalence classes of values modulo
that equivalence relation. For example, the 16-bit integer
1010010101010111 and the 16-bit integer 1010010101010111 are two
distinct objects, both structurally strings of ASCII characters in
binary notation, with identical bit patterns, hence in the same
equivalence class modulo such structural comparisons, but located
in two different places, at the left margin and about 2/3 of the
way toward the right margin. (And the copies of those
string-numbers that you see on your machine are two additional
instances of that equivalence class, on *your* machine instead of
mine, which are probably in locations miles apart from my two
instances.)

In a machine, when talking about assigning a value, it's a copy of
a value that is assigned, not the original value, hence we're using
the word "value" to mean an equivalence class rather than a single
instance. The precise definition of such an equivalence relation
would involved causality, that if a value is copied directly it's
the "same" (modulo the equivalence relation) whereas if an equal
value happens to arise independently it's not the "same" value even
though it's an "equal" value.

When you think of it, that's why you need runtime equality
checking, to determine, in the case of two values which are not
"same", nevertheless whether they happen to be "equal" anyway. If
you copied a value directly and then tested for equality,
long int x; long int y=42;
x = y;
if (x == y) ...equalaction...; else ...diffaction...;
the compiler could recognize the tautological nature of the
comparison and optimize it to be done at compile time and generate
a runtime constat TRUE value
long int x; long int y=42;
x = y;
if (TRUE) ...equalaction...; else ...diffaction...;
instead of a runtime comparison to compute a TRUE/FALSE value which
is always TRUE. In fact the optimizing compiler could eliminate the
test entirely and not even compile the unrerachable code.
long int x; long int y=42;
x = y;
...equalaction...; /* Unreachable code ...diffaction...; */
But if two values are generated independently, there's no way the
compiler can know whether they will be equal or not a runtime, so
an actual runtime comparison must be compiled.
long int x; long int y=42;
scanf("%d", x);
if (x == y) ...equalaction...; else ...diffaction...;
Now if you want
to make the claim that an lvalue in c is really a pointer,
I don't. (But is has some of the same behaviours.)
I've recently decided that due to the C-biassed definition of
"pointer", then perhaps "effective address" is the correct jargon
to use. But on the other hand, so-called "lvalues" in C have a size
and intentional type as well as just a machine address, so maybe
"effective address" doesn't really capture the whole nature, so
maybe "effective datatyped pointer" or "datatyped effective
address" is more accurate jargon. The idea is you have three things
intertwined:
- The machine address of the first addressible unit of storage;
- The number of addressible units, or contrarywise the byte
position within a single addressible unit, such as 7-bit ASCII
byte within 36-bit addressible unit on PDP-10 or 16-bit UCS-16
character in Java 1.3 on a 32-bit or 64-bit computer;
- The meaning of that storage, whether 2's-complement integer, or
unsigned integer, or IEEE floating point value, or ASCII
character, or EBCDIC character, or IBM-PC character, or Latin-1
character, or UCS-16 character, or 32-bit Unicode character, or
UTF-8 byte which may be a full ASCII character or just part of
any other UniCode character, or a bitmask, or a bitmask
representing a subset of a particular universal set, or a
boolean where all but one bit are ignored, or a boolean where
all bits zero means FALSE and any other combination is treated
as if TRUE, etc.
That entity is either a loadtime constant (compiletime constant
subsequently adjusted i.e. offset by loader), such as for a static
variable, or a runtime-offset value, such as stack-allocated
variable which is compiletime constant offset from stack pointer,
or fully runtime computed value, such as array element or
dereferenced pointer. But whatever the nature of generating that
entity, what you end up with (just before you fetch the value there
or store a new value there or just pass the entity as a parameter
to some other function), the entity has those three properties the
same in any case, however it was generated. I'm leaning toward that
last jargon I invented "datatyped effective address" to clearly
show that it isn't necessarily a compiled constant (hence the
"effective"), that it has an address as part 1 (hence the
"address"), and that it has both size and meaning (hence the
"datatyped" which includes both concepts together, which is why
both sizeof(type) and static_cast (C++ jargon which clarifies
what C casting usually does) work).
I'd be
willing to listen to your argument. But I'm not going to just
assume you mean that unless you say so and give some reasoable
argument that it covers all cases.
This is not the time nor the place for a tutorial on the
fundamental concepts of programming languages. So I won't
give one. Do your own homework.
The purpose of asking for you to explain what precisely you mean is
that you have been ambiguous and I don't understand what you are
saying but if you explain precisely what you mean then perhaps I
will finally understand which of several possible interpretations
of your previous utterances is correct. Unless my homework involves
kidnapping you and using torture or sodium pentathol to force you
to reveal what you mean, there's no way my "homework" can resolve
the question as to your intended meaning. It's up to you to either
explain what you meant, as I requested, or refuse, and have me
dismiss everything you ever said that wasn't fully
clear/unambiguous. If you choose to post ambiguous garbage and then
refuse to clarify, i.e. if you refuse to communicate meaingfully,
that's your choice.
, happens when/where? In the compiler during
compilation? Or at runtime?? Or some other time?
It doesn't matter when, so long as the right [defined by
specification] answer is arrived at.
The so-called specification (C1999) is not a specification at all
because it's ambiguous, leaves some issues totally unresolved,
undefined, really basic things like "lvalue" which is used all over
the place. My choice at the moment is to dismiss those parts of the
so-called specification as garbage and simply ignore them and
substitute my own personal explanation of what happens with an
"assignment".
Also, I don't understand what that parameter 'store' is in your
call to the update function/macro.
It's the store, the place where values live:
update( store, lvalue, rvalue )
delivers a new store which is the same as `store` except the
value at `lvalue` is now `rvalue`. Perfectly straightforward
denotational semantics.
Ah, thanks for explaining the notation you were using in that
example. Such is actually implementable using a BST to
emulate/implement the store, where for efficiency (both space and
time) the BST-store object you get back shares all structure with
the original BST-store object except for the log(n) path down to
the single location which was updated between the old and new
BST-store objects. (I've actually written code like that, in lisp
of course. Someday maybe I'll try the same functionality in
PHP/perl... I wonder if there's any relational-database system that
supports such functional-language-style updates.)
lvalues are identifiers for places to put things
I really like that way of putting it!! I'm going to pounce on you
and not let you retract that! Like I've been saying all along, an
<cJargon>lvalue</cJargonis very much like a
<lispJargon>place</lispJargon>, and the lisp jargon is less
confusing, and I'm pleased you've essentially adopted the lisp
jargon "place" here. As for the distinction between the identifer
for a place and the place itself, that's too nitpicky to be worth
distinguishing in most of this discussion. Technically an lvalue is
the place itself, not the identifier of that place, but that's too
nitpicky a distinction here.
Oh. Since most people here aren't familiar with lisp
I don't know how you'd know that.
Because what they say *about* lisp is so grossly wrong that nobody
who knew beans about lisp beyond the look of the syntax would ever
say such a thing about lisp. It's like if somebody told you that C
can't be used for anything except device drivers and operating
systems, you'd know the person didn't have any clear idea of C,
right? Way back in the days of MacLisp, timing tests showed that
lisp used for numerical calculations was slightly faster than
fortran, generating identical machine instructions within each
individual function, but having more efficient linkage when one
function calls another. Yet people who knew next to nothing about
lisp still claimed, to this day, that lisp is horrendously slow,
totally unsuitable for tight calculations, a totally false claim
from know-nothings. Likewise people are still saying that lisp is
suitable only for A.I., not for day-to-day data-processing
applications, again totally false from know-nothings.

Even the fact that people use c for applications that would be much
more appropriate in lisp show widespread lack of understanding of
lisp. Like why would somebody spend a month writing a new one-time
application in c, and never getting it fully working, when it would
take three or four days in lisp and be fully working from the
get-go, except if they really didn't understand lisp.
I haven't dismissed /any/ Lisp jargon.
Yes. I misunderstood you previously.
You can do something very similar using Pop11's updaters. They
don't use macros to do it: they use functions plus one assignment
rewrite rule.
"assignment rewrite rule" sounds to me like another way of saying
"setf method". How are they in any way different conceptually?
I'm interested in understanding how that is possible, but it's
getting seriously off-topic here. Would you be willing to explain
it to me privately, or in an appropriate newsgroup?

<OT>
by some kind of rewriting it to call a different function that
Yes: by calling that function's updater. The expression
V -F(X) is compiled as (F.updater)(V, X)
There's only one rewrite rule, not one per "setf method".
OK, so F isn't a function, it's an <oop>object</oop>, where the
getvalue method and the update method are both contained in the
object, and so presumably getting a value also involves a rewrite
rule
F(X) -V (F.getvalue)(X) -V
I presume, much the same as java obviously has a rewrite rule for
automatically calling the getString method whenever some object
appears in a string-needing context, such as parameter to
system.out.Println, or operand to the operator that does string
concatenation, or the way C++ has a boolean-needing context such as
inside an 'if' statement which causes a boolean-producing method
instead of the default value-producing method, which is why
if(!cin) tests for EOF on stdin instead of null pointer (and why
if(cin) tests for not-EOF instead of non-null pointer).
How is "rewrite" any different from "macro" in general anyway??
The rewrite is built in to the compiler. I would say "not user
redefinable", but Pop11's pretty open; given enough effort you
can pretty much redefine whatever you like. More to the point,
you don't change any rewrite rules and you don't create any
macros when you define Pop11's updaters.
Well, I would simply say it's a single built-in (vendor-supplied)
macro so utterly powerful that no additional macros are needed by
ordinary Pop11 users so they don't miss the ability to define more
macros of their own. In essence it's the same as a macro, or
contrarywise a macro is really a rewrite rule by a different name.
Since the word "macro" has another entirely different meaning in
common language, namely "large", I'm thinking now that "rewrite
rule" is the better, more clear, jargon. Thanks for the enlightenment.
</OT>
Mar 21 '07 #163
Robert Maas, see http://tinyurl.com/uh3t said:
>From: Chris Dollin <chris.dol...@hp.com>
There are only values, so if assignment assigns to something, it
must be a value.

A value cannot exist unless it exists somewhere. There's no such
thing as just existing without being anywhere.
So where does 42 exist, then?

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 21 '07 #164
In article <re***************@yahoo.com>,
Robert Maas, see http://tinyurl.com/uh3t <re*****@yahoo.comwrote:
>There are only values, so if assignment assigns to something, it
must be a value.
>A value cannot exist unless it exists somewhere. There's no such
thing as just existing without being anywhere. The location where a
value exists is not itself a value, it's a place, a.k.a. location.
Is this a metaphysical theory or an assertion about C?

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Mar 21 '07 #165
From: Keith Thompson <k...@mib.org>
I think the problem is that you seem to be writing your own
attribution lines. ...
I have to, or they wouldn't be there at all.
The standard form for attribution lines and quoted text is:
So-and-So <f...@bar.comwrites:
Text that So-and-So wrote ...
Any decent newsreader will do this for you automatically.
I don't have access to any such here.
<http://www.rawbw.com/~rem/NewPub/mySituation.html>
I do the best I can do with what's available here. If you don't
like how I do it, either hire me at a good enough wage that I can
pay off my credit-card debt and then have extra money left over to
buy a new computer that is capable of direct InterNet service, or
use the "any decent newsreader" you claim to be using to "killfile"
me so you'll never see anything I post and my slightly nonstandard
way of citing context won't bother you so much that you would
continue to harass me about it.
I'm posting this through a VT100 terminal emulator,
Hey, I thought I was the only person left still doing that!!
So why are you so nasty to me? You're the one person out there who
ought to understand the non-standard way I have to do things here.
but I'm able to download and view PDF files on the computer where
I'm running the emulator.
Do you happen to know where I can find a binhex of a Macintosh
version of a PDF viewer that requires less than one megabyte total?
(My hard disk is getting painfully full, can't afford more than
about one megabyte on any single addendum to what's occupying space
on hard disk. At the moment, total of 14.8 MB free on HD, and like
your mommy should have told you, "don't spend it all in one place".)
But perhaps you should try reading this:
...
| If you can't deal with PDF, search for "n869.txt"

I didn't see your article saying that until after I had already
done a Google search on a couple terms somebody else posted and
found it and downloaded:
WG14/N869 Committee Draft -- January 18, 1999
(1330770 bytes on Unix)
as I mentionned several times after you posted that while it was in
my backlog of articles not yet replied to. That looks like the same
file you're referring to. Anyway, I'm now trying desperately to
catch up with that backlog... I should have been to bed 3.26 hours ago.
Mar 24 '07 #166
Robert Maas, see http://tinyurl.com/uh3t wrote, On 24/03/07 08:17:
>From: Keith Thompson <k...@mib.org>
I think the problem is that you seem to be writing your own
attribution lines. ...

I have to, or they wouldn't be there at all.
<snip>

So why do you refuse repeated requests that you type two fewer
characters. What is so hard about NOT typing "" before you type "From:
....".
--
Flash Gordon
Mar 24 '07 #167
From: pete <pfil...@mindspring.com>
If M and N are short integers,
then M+N is an expression of type int and not of type short.
Hmm, so you can do this:
short int M = MAX_SHORT_INT; (whatever the correct name is, DWIM here)
short int N = MAX_SHORT_INT;
int MPN;
MPN = M + N;
and MPN is guaranteed to have the correct value without short-int wraparound?
I suppose that's good to know. But on the other hand, int can in fact
be implemented as either long int or short int or anything between,
so unless you know that your implementation has int with at least one
more bit than short int, the above is all false, int might wrap around
because it's just short int on that implementation. So maybe that
is of no value, can't rely on any portable behaviour there, because
the size of int isn't portable.
If (M+N) overflows, then the result is undefined.
Ah, thanks for the enlightenment. Yes, I see now that's correct.
Let me check whether my CookBook/Matrix ever mentions either overflow
or wraparound ... OK I fixed the places where overflow is mentionned
in both CookTop.html and Matrix.html, so instead of saying it doesn't
check for overflow, now it says it doesn't necessarily check for
overflow, i.e. it might check or might not, and that the behaviour
is undefined. I kept in the remark about use of such functions (for
example atol) is not recommended, and now the reason is more clear.
Mar 24 '07 #168
From: Erik de Castro Lopo <e...@mega-nerd.com>
The current official C standard, C99, was issued by ISO (and
later adopted by ANSI).
So it would seem reasonable, in articles posted any time from about
2000 to the present and for a while in the future, to call it "ANSI
C", no??
ANSI is an American standard (not that there is anything wrong with
that :-)) but since this is an international newsgroup, the
international ISO standard should probably take precedence.
You have a good point. I'll try to remember to refer to it as ISO C
despite the contrary notation in the GNU C compiler that I use
here. And where there's any ambiguity about *which* edition of ISO
C, I'll refer to it as ISO C1989 or ISO C1999 (the latter being
"ISO C" per the previous sentence).

Unfortunately I don't have access to any document defining ISO
C1989, and the only document for ISO C1999 is a draft version which
is alleged to differ from the actual standard in various unknown
ways. If somebody in this newsgroup knows those differences,
perhaps that person could post a Web page that I could use for
reference? Not just for me, for anyone needing the info, but at the
moment mostly for me.

What I *really* need is a plain-text version of ISO C1989, so I can
use that as a base for my CookBook/Matrix, since ISO C1999 isn't
yet fully implemented most (any?) places. Or maybe I should just
use the draft document as my base, with the caveat that both ISO
C1989 and ISO C1999 differ from it in various unknown ways? With
all the various standards and implementations that conflict with
each other, I'm thinking that writing portable C code really is
impossible, and I shouldn't worry about it, in particular shouldn't
waste time trying to make my CookBook/Matrix document exactly match
any hypothetical idea of "portable C code" per this or that standard.
How about "ISO C90 standard"?
Bad for two reasons:
- The ISO standard was published in 1989, not 1990.
- In the year 90, the Roman Empire was in control of Europe, and
the New World hadn't yet been discovered by my ancestors, and
people didn't realize that critical military systems would
remain non-functional for years after the y2k change, etc.

<OT>I wonder if the WTC bombing, as well as the faulty information
about WMD in Iraq, were both caused by software still not usable
after y2k, blinding our (USA) military as to what was really
happening?</OT>
Mar 24 '07 #169
Robert Maas, see http://tinyurl.com/uh3t wrote, On 24/03/07 17:56:

<snip>
Unfortunately I don't have access to any document defining ISO
C1989,
<snip>

Only true if you choose to ignore the posts where a source has been
given and you also cannot be bothered to type in "c89 draft" in to
Google. Oh, and you also cannot be bothered to check your local library
to see what books they might have or be able to get.
>How about "ISO C90 standard"?

Bad for two reasons:
- The ISO standard was published in 1989, not 1990.
Wrong. As you have already been told ANSI published it in 1989 and ISO
adopted it in 1990.
- In the year 90, the Roman Empire was in control of Europe, and
<snip more irrelevant stuff>

Do you seriously think there is some chance of confusion or are you just
being deliberately awkward?
--
Flash Gordon
Mar 24 '07 #170
Robert Maas, see http://tinyurl.com/uh3t said:
>From: pete <pfil...@mindspring.com>
If M and N are short integers,
then M+N is an expression of type int and not of type short.

Hmm, so you can do this:
short int M = MAX_SHORT_INT; (whatever the correct name is, DWIM
here) short int N = MAX_SHORT_INT;
int MPN;
MPN = M + N;
and MPN is guaranteed to have the correct value without short-int
wraparound?
No, because there is no guarantee that int is wider than short.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 24 '07 #171
From: Flash Gordon <s...@flash-gordon.me.uk>
Please tell me whether GNU C MAN pages are referring to C99 or what?
If you read the rest of the GCC documentation you will find one of two
things:
1) It tells you that it is referring to C89
2) It is a version pre-dating C99 which would therefore obviously not be
referring to C99.
I spent a long time reading/skimming all the way to the end of the
man pages, and saw no such information. I saw a reference to info
pages, so I tried info gcc, which put me into EMACS INFO mode with
no idea how to navigate it. It's been more than 20 years since I've
used EMACS INFO mode and I simply can't remember how to follow a
link there.
Mar 24 '07 #172
From: Mark McIntyre <markmcint...@spamcop.net>
The San Francisco Bay Area is considered a region,
You're pretty much making my point by this bollocks. the Bay Area may
be a postal region or tax region (for all I know) but its not a
geological region, nor yet a weather region.
You're definitely making my point, that for the C spec to simply
say that an lvalue is defined as something that specifies a region
but fails to say what kind of region, is not a specification at
all.
Common Sense says that Neptune hasn't cleared its neighborhood of
Pluto, and the Earth hasn't cleared its neighborhood of Luna, and
Jupiter hasn't cleared its neighborhood of Io or Europa or Ganymede
or Calisto. So none of those is a planet per IAU's 2006 definition???
Apparently you're unfamilar with the meaning of yet another phrase...
What do you mean "the meaning"?? The phrease "clear its
neighborhood" could mean almost anything. It must have tens, maybe
even hundreds, of different meanings. No one of those many meanings
is "the meaning".
Mar 24 '07 #173
re*****@yahoo.com (Robert Maas, see http://tinyurl.com/uh3t) writes:
>From: Keith Thompson <k...@mib.org>
I think the problem is that you seem to be writing your own
attribution lines. ...

I have to, or they wouldn't be there at all.
Then can you at least do it *right*? Rather than manually typing
From: Keith Thompson <ks***@mib.org>
(or whatever mechanism you're using), you could manually type

Keith Thompson <ks***@mib.orgwrites:

The form of an attribution line can vary, but it should include the
poster's name and/or address, and it *shouldn't* start with ">" or the
word "From".
>The standard form for attribution lines and quoted text is:
So-and-So <f...@bar.comwrites:
> Text that So-and-So wrote ...
Any decent newsreader will do this for you automatically.

I don't have access to any such here.
<http://www.rawbw.com/~rem/NewPub/mySituation.html>
I do the best I can do with what's available here.
I believe you can do better.
If you don't
like how I do it, either hire me at a good enough wage that I can
pay off my credit-card debt
[snip]

Please read the article I posted recently with the "open classroom"
analogy. We can't do anything about your personal situation. There
are several billion people who are worse off than you are. After
we've helped all of them, perhaps we can get to you. There are
support groups out there; please find one rather than using
comp.lang.c to tell us about your personal problems.

[...]
>I'm posting this through a VT100 terminal emulator,

Hey, I thought I was the only person left still doing that!!
I seriously doubt it.
So why are you so nasty to me? You're the one person out there who
ought to understand the non-standard way I have to do things here.
I'm not being nasty. I'm trying to be as helpful as I can. But if
you think I'm being nasty, then you're perfectly free to ignore me.
(No killfile is needed; just skip any article with my name on it.)
Please let me know if you decide to take this route, so I won't waste
my time offering you any more advice. (To be clear, I'm not being
sarcastic about this.)

There are plenty of decent newsreaders that run just fine on terminals
or terminal emulators. I use Gnus, which runs under Emacs; others
include tin, nn, pine, trn, slrn, and even the ancient rn.

Perhaps your situation doesn't allow you to use any of them, but you
might consider looking into it. (I think you said you dial into a
Unix system; I'd be surprised if it didn't have some newsreader
available.)
>but I'm able to download and view PDF files on the computer where
I'm running the emulator.

Do you happen to know where I can find a binhex of a Macintosh
version of a PDF viewer that requires less than one megabyte total?
Not a clue. Try asking in a Macintosh newsgroup, or doing a Google
search.

[...]

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 24 '07 #174
re*****@yahoo.com (Robert Maas, see http://tinyurl.com/uh3t) writes:
Erik de Castro Lopo <e...@mega-nerd.comwrites:
[attribution line fixed]
>How about "ISO C90 standard"?

Bad for two reasons:
- The ISO standard was published in 1989, not 1990.
No, the ISO standard was published in 1990.
- In the year 90, the Roman Empire was in control of Europe, and
[snip]

I understand the point, and I also prefer to represent years in 4
digits whenever possible. But in this case, there is a nearly
universal existing convention to refer to the various standards as
"C89", "C90", and "C99". Calling them "C1989", "C1990", and "C1999"
does not increase clarity (nobody is going to think the ancient Romans
had a standard for the C programming language). In fact, I find the
names "C90" and "C99" more visually distinct from each other than
"C1990" and "C1999". If you're interested in being understood, I
encourage you to use the 2-digit forms.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 24 '07 #175
From: Keith Thompson <k...@mib.org>
And what exactly do you mean by "ANSI"?
Whatever is the **current** (latest official) standard.
At the moment, that seems to be C99.
Ok. You need to be aware, though, that a lot of people use the
term "ANSI C" to refer to the language defined by the 1989 ANSI
standard. Which is why I refer to "C90" or "C99", to avoid the
potential ambiguity.
Yeah. Earlier postings have convinced me of that ambiguity indeed.
(I'm still desperately trying to catch up with my backlog.)
Or whatever the GNU C compiler uses when the -ansi switch is turned
on. From the man pages here:
[snip]
gcc's "-ansi" option is equivalent to "-std=c90" or
"std=iso9899:1990". (I've suggested that "std=c89" should also
be accepted.) So, as you can see, the term "ANSI C" is ambiguous.
I wasn't able to find that in the man pages. Let me quote exactly
what I see there:

-ansi Support all ANSI standard C programs.

This turns off certain features of GNU C that are incompatible
with ANSI C, such as the asm, inline and typeof keywords, and
predefined macros such as unix and vax that identify the type of
system you are using. It also enables the undesirable and
rarely used ANSI trigraph feature, and disallows `$' as part of
identifiers.

The alternate keywords __asm__, __extension__, __inline__ and
__typeof__ continue to work despite `-ansi'. You would not want
to use them in an ANSI C program, of course, but it is useful to
put them in header files that might be included in compilations
done with `-ansi'. Alternate predefined macros such as __unix__
and __vax__ are also available, with or without `-ansi'.

The `-ansi' option does not cause non-ANSI programs to be re-
jected gratuitously. For that, `-pedantic' is required in addi-
tion to `-ansi'.

The preprocessor predefines a macro __STRICT_ANSI__ when you use
the `-ansi' option. Some header files may notice this macro and
refrain from declaring certain functions or defining certain
macros that the ANSI standard doesn't call for; this is to avoid
interfering with any programs that might use these names for
other things.

I've looked over that text several times, and even did a search
after loading it into a text editor, and I still don't see it say
what you are saying, not a single mention of 89 or 90 anywhere
there. Apparently the man pages on your system are better in this
respect than the man pages on this ISP shell account I'm using.

In any case, I'm thoroughly convinced "ANSI C" is too ambiguous for
my purposes.
The gcc documentation refers to C89 when it discusses the "-ansi"
option.
What documentation are you referring to? Not the 'man' pages here!!
I would consider that "old ANSI C", specifically "previous ANSI C".
Or you could call it "ANSI C89".
Somebody just before you pointed out that this is an international
newsgroup and I should use the ISO designation instead of the ANSI
designation. And to be y2k safe, I'll use the full four-digit year.
What about C89 as an alternate designation for C90?
(ISO standardized it in 1989, but ANSI didn't join in approving it
until 1990, right. So from ISO's point of view, it's really C89?)
Not quite. ANSI issued a C standard (the first one) in 1989. ISO
adopted it, with some non-substantive changes, in 1990; ANSI then
adopted the 1990 ISO standard as an ANSI standard.
OK, I'm just going to take your word for that, you anonymous person
I've never met who is posting from some unknown IP number
(apparently part of RoadRunner ISP, which fails to include the NNTP
posting host like most other ISPs do), because I don't have any
more energy to check facts myself. So it's now ISO C1990 in my book.
I don't remember where your Matrix is.
<http://www.rawbw.com/~rem/HelloPlus/CookBook/Matrix.html>
<http://cbfalconer.home.att.net/download/n869_txt.bz2is a
compressed (with bzip2) plain-text draft.
Ah, so it's *not* plain text, it's compressed with a nonstandard
compressor which confuses lynx (and me, using lynx to view it).
From a different source I downloaded:
WG14/N869 Committee Draft -- January 18, 1999
Is that the same as the bzip2-compressed document you cited? If so,
then I guess this search-for-plain-text-standard is nearly
finished, still no plain text of the actual standard (neither 1990
or 1999), but this draft pretty close to ISO C1999.
n1124.pdf is what I use. Adobe Reader is able to translate it to
plain text. The result isn't as nicely formatted as n869.txt,
but it has the advantage that it includes the full C99 standard
plus the two Technical Corrigenda.
That might be useful.
I already offered to send you a copy; you'll need to contact me
and let me know how to get it to you (compressed? if so, how?
e-mail? ftp? www?).
If you e-mail as an attachment (gzip preferred if not plain text),
be sure to go to my Web site to see what keyword has to be in the
Subject field so I'll arrive separated from the
hundred-spam-per-day so I'll ever see it.

If you make it available by FTP or HTTP, you can post the URL
either in the newsgroup, where I may or may not discover it via
Google search, or e-mail the URL with the Subject-field tag to
separate it from spam.
Most of us find the PDF version sufficiently useful.
Most of you have enough income to be able to afford a new computer
every several years and live PPP access for each such computer. My
current computer was already very old when I bought it used in
1998, but it was all I could afford, and currently I would't be
able to afford even it, so it's good that I bought it when I did or
I'd be totally without computer ever since mid-1999 when my even
older Mac Plus died.
Mar 24 '07 #176
Robert Maas, see http://tinyurl.com/uh3t wrote, On 24/03/07 21:09:
>From: Flash Gordon <s...@flash-gordon.me.uk>
Why are you still insisting on putting "" before the attribution line
when you have had multiple requests not to? Are you *trying* to make it
harder for everyone else? The request is for you to do *less* typing, so
you can't complain we are trying to make you do more work. Your method
tells people that it was my asking whether the GNU C MAN pages are
referring to C99 and some unknown person answering, when in fact it was
me doing the answering and you asking.
>>Please tell me whether GNU C MAN pages are referring to C99 or what?
If you read the rest of the GCC documentation you will find one of two
things:
1) It tells you that it is referring to C89
2) It is a version pre-dating C99 which would therefore obviously not be
referring to C99.

I spent a long time reading/skimming all the way to the end of the
man pages, and saw no such information. I saw a reference to info
pages, so I tried info gcc, which put me into EMACS INFO mode with
no idea how to navigate it. It's been more than 20 years since I've
used EMACS INFO mode and I simply can't remember how to follow a
link there.
The gcc documentation includes info pages, if you don't read those then
you can't claim to have looked through the documentation. I found it
easy enough to find out how to use info, info unsurprisingly enough
comes with documentation on how to use it. Or you could read the
documentation in the obvious place on the web.
--
Flash Gordon
Mar 24 '07 #177
On Sat, 24 Mar 2007 15:14:28 -0700, Keith Thompson <ks***@mib.orgwrote:
>
...nobody is going to think the ancient Romans had a standard for the C
programming language.
Well, this may be true. On the other hand it's a historical fact that "one of
the main causes of the fall of the Roman Empire was that, lacking zero, they
had no way to indicate successful termination of their C programs." :-)
G. H.

--

E-mail: info<at>simple-line<Punkt>de
Mar 24 '07 #178
From: Richard Heathfield <r...@see.sig.invalid>
... you can get text conversions, but you tend to lose some
important format information (e.g. subscript and superscript info
is lost,
If it was ever there in the first place, why would it be lost except by
a cruddy text converter??
so you see sillinesses such as 232 - 1 on occasion).
That looks like a bug, or super-lazy algorityhm, not an inherent
limitation of the task.
or you're saying you don't recognise bzip2 format.
I never heard of bzip2 before. Lynx never heard of it either,
passes it verbatim to the VT100, which results in garbage. I
checked, and bzip2 is in fact available here on the Unix shell
machine, so if I ever really need such a file I can short-circuit
lynx to download it and then manually decompress it.
Now if you would be so kind as to translate that to English...
You can do it yourself, using bunzip2. Furrfu.
Yeah, I know that now, after reading the man pages here.
Mar 24 '07 #179
From: "Stephen Sprunk" <step...@sprunk.org>
If you're on a unix-ish system, try "man func" ...
% man func
No manual entry for func
% man strtoll
NAME
strtol, strtoll, strtoq -- convert a string value to a long, long long,
or quad_t integer
LIBRARY
Standard C Library (libc, -lc)
STANDARDS
The strtol() function conforms to ISO/IEC 9899:1990 (``ISO C89''). The
strtoll() function conforms to ISO/IEC 9899:1999 (``ISO C99''). The BSD
strtoq() function is deprecated.

Hey, I never heard of that before. Thanks.
If you work with a lot of unix-ish code, you'll see that a lot of
functions you're used to will be listed as conforming to POSIX
and _not_ C89/99. For example, compare the man pages for open()
and fopen().
% man open
(No mention of STANDARDS)
% man fopen
STANDARDS
The fopen() and freopen() functions conform to ISO/IEC 9899:1990
(``ISO C89''). The fdopen() function conforms to IEEE Std 1003.1-1988
(``POSIX.1'').
Mar 25 '07 #180
On Sat, 24 Mar 2007 14:17:21 -0700, in comp.lang.c , re*****@yahoo.com
(Robert Maas, see http://tinyurl.com/uh3t) wrote:
>From: Mark McIntyre <markmcint...@spamcop.net>
>The San Francisco Bay Area is considered a region,
You're pretty much making my point by this bollocks. the Bay Area may
be a postal region or tax region (for all I know) but its not a
geological region, nor yet a weather region.

You're definitely making my point, that for the C spec to simply
say that an lvalue is defined as something that specifies a region
but fails to say what kind of region, is not a specification at
all.
Myself, I suspect its reasonable to assume its a region of memory. Not
a region of geography, or of religious persuasion, or of politics, or
weather, or any other sort of highly irrelevant region. However I
can't help it if you're obtuse, so I'll say no more about it.
>What do you mean "the meaning"??
....
No one of those many meanings is "the meaning".
Sure Ludwig, and anytime I want to argue philosophy, I'll know where
to come. Meantime I suggest you get a grip.

http://en.wikipedia.org/wiki/Ludwig_...#The_Tractatus
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Mar 25 '07 #181
"Robert Maas, see http://tinyurl.com/uh3t" <re*****@yahoo.comwrote in
message news:re***************@yahoo.com...
You have a good point. I'll try to remember to refer to it as ISO C
despite the contrary notation in the GNU C compiler that I use
here. And where there's any ambiguity about *which* edition of ISO
C, I'll refer to it as ISO C1989 or ISO C1999 (the latter being
"ISO C" per the previous sentence).
If you use the terms C89, C90, or C99, folks here will know what you're
referring to. C89 and C90 are effectively identical; the sections are just
numbered differently. For historical reasons, GCC (like many other
compilers) refers to C89 as "ANSI C".

Note that GCC compiles a language it calls "GNU89" by default
(-std="gnu89"), and "-ansi" or "-std=c89" or "-std=c90" gets you C89/C90.
"-std=c99" will get you mostly-functional C99 support, and "-std=gnu99" gets
you that plus various GCC extensions.
Unfortunately I don't have access to any document defining ISO
C1989, and the only document for ISO C1999 is a draft version which
is alleged to differ from the actual standard in various unknown
ways. If somebody in this newsgroup knows those differences,
perhaps that person could post a Web page that I could use for
reference? Not just for me, for anyone needing the info, but at the
moment mostly for me.
The differences between the draft and the final standard are minor and
nobody here will fault you for missing them. Virtually everyone here cites
n1124.pdf and not the actual standard anyways.

S

--
Stephen Sprunk "Those people who think they know everything
CCIE #3723 are a great annoyance to those of us who do."
K5SSS --Isaac Asimov
--
Posted via a free Usenet account from http://www.teranews.com

Mar 25 '07 #182
Flash Gordon wrote:
Robert Maas wrote:
>>
.... snip Maasive sobs ...
>
The gcc documentation includes info pages, if you don't read those
then you can't claim to have looked through the documentation. I
found it easy enough to find out how to use info, info
unsurprisingly enough comes with documentation on how to use it.
Or you could read the documentation in the obvious place on the web.
Or he could do as he is prompted at the initial window, type '?'
and get an introduction to the system. However I suspect he would
rather cry about it.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

--
Posted via a free Usenet account from http://www.teranews.com

Mar 25 '07 #183
From: Richard Heathfield <r...@see.sig.invalid>
So where does 42 exist, then?
That particular 42 exists in the article you posted, more
specifically different copies of it exist in hundreds of computers
around the world. At the abstract level there is a hierarchy of
equivalance classes ascending from those instances:
- All those copies in your actual article
- All copies of those in followup articles and other snippets of
text copied from some instance of your article.
- All instances of that number, in any form, which are casually
connected to the instances in copies of your article.
- All instances of that equal numeric value regardless of whether
casually connected or not.
Mar 25 '07 #184
From: rich...@cogsci.ed.ac.uk (Richard Tobin)
A value cannot exist unless it exists somewhere. There's no such
thing as just existing without being anywhere. The location where a
value exists is not itself a value, it's a place, a.k.a. location.
Is this a metaphysical theory or an assertion about C?
It's basically an assertion about C, that C is designed to run on
Von Neumann machines, where there's a store of addressible memory,
a PC that ascends addresses consecutively except when a branch
instruction of some sort alters that sequence, instructions and
data both laid out in this addressible memory. C is merely an
abstraction of that Von Neumann machine, where you use alphanumeric
names for places where data is stored and for entry points for
functions instead of using the numerical machine addresses
directly, and where branching instructions are hidden within higher
level abstractions such as IF/WHILE statements and function calls.
Mar 25 '07 #185
re*****@yahoo.com (Robert Maas, see http://tinyurl.com/uh3t) writes:
[...]
I spent a long time reading/skimming all the way to the end of the
man pages, and saw no such information. I saw a reference to info
pages, so I tried info gcc, which put me into EMACS INFO mode with
no idea how to navigate it. It's been more than 20 years since I've
used EMACS INFO mode and I simply can't remember how to follow a
link there.
I'll just mention that if you have Emacs, then you have Gnus, the
newsreader I use. And you almost certainly have other good
newsreaders available to you.

I don't know what you're using now. Unless you're typing NNTP
protocol commands directly, you're using *some* newsreader. I've
never heard of a modern newsreader that doesn't automatically generate
proper attribution lines for followups.

I haven't a clue what your problem with attribution lines is, but it
should be easy to fix, one way or another, if you care to do so.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 25 '07 #186
"Stephen Sprunk" <st*****@sprunk.orgwrites:
"Robert Maas, see http://tinyurl.com/uh3t" <re*****@yahoo.comwrote
in message news:re***************@yahoo.com...
[...]
>Unfortunately I don't have access to any document defining ISO
C1989, and the only document for ISO C1999 is a draft version which
is alleged to differ from the actual standard in various unknown
ways. If somebody in this newsgroup knows those differences,
perhaps that person could post a Web page that I could use for
reference? Not just for me, for anyone needing the info, but at the
moment mostly for me.

The differences between the draft and the final standard are minor and
nobody here will fault you for missing them. Virtually everyone here
cites n1124.pdf and not the actual standard anyways.
Right, but the most easily usable plain ASCII version is n869, which
predates the C99 standard. n1124.pdf is later than, and is based on,
the C99 standard, and the differences are clearly marked with change
bars. (I don't think the change bars were preserved when I exported
n1124.pdf to plain text.)

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 25 '07 #187
re*****@yahoo.com (Robert Maas, see http://tinyurl.com/uh3t) writes:
Keith Thompson <kst-u.@mib.orgwrites:
[attribution line fixed]

[...]
><http://cbfalconer.home.att.net/download/n869_txt.bz2is a
compressed (with bzip2) plain-text draft.

Ah, so it's *not* plain text, it's compressed with a nonstandard
compressor which confuses lynx (and me, using lynx to view it).
The Unix system you dial into probably has the bzip2 and bunzip2
programs.

[...]
>n1124.pdf is what I use. Adobe Reader is able to translate it to
plain text. The result isn't as nicely formatted as n869.txt,
but it has the advantage that it includes the full C99 standard
plus the two Technical Corrigenda.

That might be useful.
>I already offered to send you a copy; you'll need to contact me
and let me know how to get it to you (compressed? if so, how?
e-mail? ftp? www?).

If you e-mail as an attachment (gzip preferred if not plain text),
be sure to go to my Web site to see what keyword has to be in the
Subject field so I'll arrive separated from the
hundred-spam-per-day so I'll ever see it.

If you make it available by FTP or HTTP, you can post the URL
either in the newsgroup, where I may or may not discover it via
Google search, or e-mail the URL with the Subject-field tag to
separate it from spam.
http://home.san.rr.com/smov/n1124.txt.gz

It won't be there indefinitely, so don't bother bookmarking it.
Please let me know (by posting a followup here) when you've downloaded
it.
>Most of us find the PDF version sufficiently useful.

Most of you have enough income to be able to afford a new computer
every several years and live PPP access for each such computer.
Ok, you're broke. We get it. Nobody here is responsible for that
fact, or in a position to do anything about it. Do you *have* to
bring up your personal economic situation every time you post here?

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 25 '07 #188
re*****@yahoo.com (Robert Maas, see http://tinyurl.com/uh3t) writes:
>From: Richard Heathfield <r...@see.sig.invalid>
So where does 42 exist, then?

That particular 42 exists in the article you posted, more
specifically different copies of it exist in hundreds of computers
around the world. At the abstract level there is a hierarchy of
equivalance classes ascending from those instances:
- All those copies in your actual article
- All copies of those in followup articles and other snippets of
text copied from some instance of your article.
- All instances of that number, in any form, which are casually
connected to the instances in copies of your article.
- All instances of that equal numeric value regardless of whether
casually connected or not.
No, you're talking about particular *instances* of 42. The question
is, where does 42, not any instance of it, not any set of instances of
it, exist? The answer is nowhere; it has no location, and the
question is meaningless.

In C terms, &42 is an error; the language doesn't even give you a way
to *ask* where 42 is located.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 25 '07 #189
re*****@yahoo.com (Robert Maas, see http://tinyurl.com/uh3t) writes:
rich...@cogsci.ed.ac.uk (Richard Tobin) writes:
[attribution line fixed]
>A value cannot exist unless it exists somewhere. There's no such
thing as just existing without being anywhere. The location where a
value exists is not itself a value, it's a place, a.k.a. location.
Is this a metaphysical theory or an assertion about C?

It's basically an assertion about C, that C is designed to run on
Von Neumann machines,
[snip]

A Von Neumann architecture is one with a single address space for both
data and code. This is by contrast to a Harvard architecture, in
which data and code are stored disjointly. Nothing in C specifies or
prefers one over the other.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 25 '07 #190
Keith Thompson wrote, On 25/03/07 06:14:
re*****@yahoo.com (Robert Maas, see http://tinyurl.com/uh3t) writes:
>rich...@cogsci.ed.ac.uk (Richard Tobin) writes:
[attribution line fixed]
>>>A value cannot exist unless it exists somewhere. There's no such
thing as just existing without being anywhere. The location where a
value exists is not itself a value, it's a place, a.k.a. location.
Is this a metaphysical theory or an assertion about C?
It's basically an assertion about C, that C is designed to run on
Von Neumann machines,
[snip]

A Von Neumann architecture is one with a single address space for both
data and code. This is by contrast to a Harvard architecture, in
which data and code are stored disjointly. Nothing in C specifies or
prefers one over the other.
Just to amplify the point, my first few years of C coding where mostly
on Harvard Architecture systems with 16 bit bytes and sizeof(short)==1,
sizeof(int)==1 and sizeof(long)==2. Oh, and the stack the processor
provided was only 8 levels and only used for return addresses, so the
compiler had to use another register to implement an additional stack for C.
--
Flash Gordon
Mar 25 '07 #191
On Sat, 24 Mar 2007 16:35:05 -0700, in comp.lang.c , re*****@yahoo.com
(Robert Maas, see http://tinyurl.com/uh3t) wrote:
>From: Richard Heathfield <r...@see.sig.invalid>
>or you're saying you don't recognise bzip2 format.

I never heard of bzip2 before.
Pardon me, but its hardly our fault if you're living in the computing
stone-age.

Bzip2 has been around for over a decade on any unix system you care to
mention, plus MacOS9, Windows and probably other platforms. (I dimly
recall compiling it for VMS5.2 or somesuch a while back).

If you /really/ have to live with nothing other than a unix shell via
VT100, then perhaps its time you considered flogging your ancient
computer collection and using hte proceeds to get dialup.
>Lynx never heard of it either,
Lynx knows all about it - heck,. the linux implementation of Lynx is
/released/ in bzip format. See http://lynx.isc.org/release/
>so if I ever really need such a file I can short-circuit
lynx to download it and then manually decompress it.
Read up on mime types, and how to configure lynx.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Mar 25 '07 #192
Gregor H. said:
On Sat, 24 Mar 2007 15:14:28 -0700, Keith Thompson <ks***@mib.org>
wrote:
>>
...nobody is going to think the ancient Romans had a standard for the
C programming language.
Well, this may be true. On the other hand it's a historical fact that
"one of the main causes of the fall of the Roman Empire was that,
lacking zero, they
had no way to indicate successful termination of their C programs."
:-)
Which just goes to show that you can't trust historians (any more than
you can trust journalists), because there /is/ a way to indicate
successful termination of your C program, even without zero.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 26 '07 #193
Robert Maas, see http://tinyurl.com/uh3t said:
>From: Richard Heathfield <r...@see.sig.invalid>
So where does 42 exist, then?

That particular 42 exists in the article you posted,
There is no such thing as a "particular 42". 42 is a value, not an
instance of a value.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 26 '07 #194
Robert Maas, see http://tinyurl.com/uh3t said:
>From: Richard Heathfield <r...@see.sig.invalid>
... you can get text conversions, but you tend to lose some
important format information (e.g. subscript and superscript info
is lost,

If it was ever there in the first place, why would it be lost except
by a cruddy text converter??
Feel free to write a better one.
I never heard of bzip2 before.
Has it ever occurred to you to find out?
Lynx never heard of it either,
passes it verbatim to the VT100, which results in garbage.
And by the same reasoning, my C compiler can't parse HTML, so putting C
source onto the World Wide Web is obviously a pointless waste of time.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 26 '07 #195
Robert Maas, see http://tinyurl.com/uh3t said:
>From: "Stephen Sprunk" <step...@sprunk.org>
If you're on a unix-ish system, try "man func" ...

% man func
No manual entry for func
So now you're saying you don't even understand metasyntactic variables?

I recommend that you consider a career change. Marketing, perhaps. Or
management.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 26 '07 #196
On Mon, 26 Mar 2007 02:19:01 +0000, Richard Heathfield <rj*@see.sig.invalid>
wrote:
>>>
...nobody is going to think the ancient Romans had a standard for the
C programming language.
Well, this may be true. On the other hand it's a historical fact that
"one of the main causes of the fall of the Roman Empire was that,
lacking zero, they had no way to indicate successful termination of
their C programs." :-)
Which just goes to show that you can't trust historians (any more than
you can trust journalists), because there /is/ a way to indicate
successful termination of your C program, even without zero.
Of course, there is a way to indicate successful termination of a C program,
even without zero, to-day! But the ancient C was far more primitive than our
modern one! (No standard, no K&R, nothing!)
G. H.

--

E-mail: info<at>simple-line<Punkt>de
Mar 26 '07 #197
Richard Heathfield wrote:
Robert Maas, see http://tinyurl.com/uh3t said:
>Richard Heathfield <r...@see.sig.invalid>
>>So where does 42 exist, then?

That particular 42 exists in the article you posted,

There is no such thing as a "particular 42". 42 is a value, not
an instance of a value.
As long as you are gaily bandying about 42s, how about slipping me
one to substitute for my age?

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

--
Posted via a free Usenet account from http://www.teranews.com

Mar 26 '07 #198
"Gregor H." wrote:
Richard Heathfield <rj*@see.sig.invalidwrote:
>>>...nobody is going to think the ancient Romans had a standard
for the C programming language.

Well, this may be true. On the other hand it's a historical fact
that "one of the main causes of the fall of the Roman Empire was
that, lacking zero, they had no way to indicate successful
termination of their C programs." :-)
Which just goes to show that you can't trust historians (any more
than you can trust journalists), because there /is/ a way to
indicate successful termination of your C program, even without
zero.

Of course, there is a way to indicate successful termination of a
C program, even without zero, to-day! But the ancient C was far
more primitive than our modern one! (No standard, no K&R, nothing!)
Note that the earliest Roman C specification didn't appear until
100, and that they didn't get a CC compiler until 200. Nero and
the burning of Rome set them back a bit. At any rate this finally
gives a rational reason for the names.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

--
Posted via a free Usenet account from http://www.teranews.com

Mar 26 '07 #199
CBFalconer said:
Richard Heathfield wrote:
>Robert Maas, see http://tinyurl.com/uh3t said:
>>Richard Heathfield <r...@see.sig.invalid>

So where does 42 exist, then?

That particular 42 exists in the article you posted,

There is no such thing as a "particular 42". 42 is a value, not
an instance of a value.

As long as you are gaily bandying about 42s, how about slipping me
one to substitute for my age?
Sure - just as soon as Robert tells us where 42 may be found.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 26 '07 #200

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.