The lcc-win string library

C

CBFalconer

Keith said:
[...]
CBF - 84 years old, and hopefully any day now Usenet will have
the blessed relief of the end of his presence on earth.

I'm quoting this just in case anyone still thought Antoninus
Twink was anything more than a waste of bandwidth. Publicly
wishing for someone's death is despicable, and this is not the
first time he's done it.

Not only that, but his faulty facts make it obvious that his
statements are purely the product of his faulty imagination.
 
K

Keith Thompson

CBFalconer said:
There is a major problem here. There is no such thing as a "string
type" in C. There is only a data format for use in a char array.
This consists of characters, extended and terminated by a '\0'
char. That char marks the end of the active string.

I think you've missed (or are deliberately ignoring) the context.
jacob announced a string library; a "string" here is presumably some
type specific to the package, not a "string" in the sense defined in
the C standard. I.e., it's something that represents or contains a
sequence of characters. <OT>C++'s std::string is an example of
this. said:
No cast will so alter the char array, and there is no guarantee
that there is even room to append the '\0' termination marker.
Remember that, in accurate C, a cast is usually an error. The
prime exception is variadic parameters.

Sure, but lcc-win, on which this string library depends, supports
operator overloading. Apparently the cast operator is overloaded so
that (char*)s invokes a function that returns a char* value that
points to a valid C string, given that s is an object of the "string"
type provided by the library.

Complain that this is off-topic if you like, but pretending,
deliberately or otherwise, that jacob means the same thing the
standard does when he talks about a "string library" is not helpful.
 
J

jacob navia

Antoninus said:
What, haven't you heard of Wine then Heathfield?

Then, a compiler is an arbitrary program that executes in your
computer... For instance a thing called 'gcc.exe' starts suspicius
other programs called 'cc1.exe' and what have you :)

At least, lcc.exe doesn't start any other program behind
your back. The preprocessor is integrated, together
with the assembler.
 
J

jacob navia

That's OK for printf arguments, but not for the sprintf result or scanf
arguments since it subverts the "no buffer overflows" the string type is
supposed to provide.

Yes, that is an issue. I have to provide
Sprintf, that would return a newly allocated string.
 
J

jacob navia

Antoninus said:
CBF - 84 years old, and hopefully any day now Usenet will have the
blessed relief of the end of his presence on earth.

Please, that was too much.

We will all die, sooner or later. Even if Chuck doesn't like me,
I do respect him and do not wish him any harm.

Let's keep cool Antoninus.

Thanks.
 
C

CBFalconer

Keith said:
I think you've missed (or are deliberately ignoring) the context.
jacob announced a string library; a "string" here is presumably
some type specific to the package, not a "string" in the sense
defined in the C standard. I.e., it's something that represents
or contains a sequence of characters. <OT>C++'s std::string is
an example of this.</OT>

Missed. I only looked at the message I quoted, I specifically did
NOT look back to investigate the general subject of the thread.
This only emphasizes that such non-topical discussion do not belong
here, especially when the comp.compilers.lcc group is available for
on-topic discussion.
 
K

Keith Thompson

CBFalconer said:
Missed. I only looked at the message I quoted, I specifically did
NOT look back to investigate the general subject of the thread.
This only emphasizes that such non-topical discussion do not belong
here, especially when the comp.compilers.lcc group is available for
on-topic discussion.

The fact that jacob was talking about converting "from the string type
o a null-terminated C-style string", plus the subject header "The
lcc-win string library", should have been more than enough of a clue,
don't you think? All that information was in the message you quoted.
 
C

CBFalconer

Richard said:
CBFalconer said:



That's a poor strategy that often embarrasses you. I suggest you
revise it.

No, it doesn't. It may embarrass the writer of the replied to item.
 
C

CBFalconer

Richard said:
CBFalconer said:

How does your ignorance of context embarrass anyone but you?

When the original author is too ignorant to realize that Usenet
does not guarantee any deliveries, and that all messages should
stand by themselves, he (or she) only embarrass themselves by
failing to effectively quote. Similarly failure to adequately
snip. Note that such ignorance is not usually fatal, and can be
corrected by heeded advice.

<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
 
K

Keith Thompson

CBFalconer said:
When the original author is too ignorant to realize that Usenet
does not guarantee any deliveries, and that all messages should
stand by themselves, he (or she) only embarrass themselves by
failing to effectively quote. Similarly failure to adequately
snip. Note that such ignorance is not usually fatal, and can be
corrected by heeded advice.

Chuck, there was more than enough information *in the article you
replied to* to make it perfectly obvious that jacob wasn't talking
about "strings" as defined by C99 7.1.1p1, and you replied as if that
were the only thing he could possibly have meant.

Here's the context that you quoted yourself:

| (e-mail address removed) wrote:
| >
| ... snip ...
| >
| >> This is suboptimal, and I will hack the printf functions later
| >> to accept some new marker for those strings, like "%{S}"
| >
| > I think that having an easy way to convert from the string type
| > to a null-terminated C-style string should be enough (and the
| > cast fulfills this purpose).

Just what did you think converting from "the string type" to "a
null-terminated C-style string" meant, in an article with the subject
"The lcc-win string library"?
 
R

Richard Tobin

How does your ignorance of context embarrass anyone but you?
[/QUOTE]
When the original author is too ignorant to realize that Usenet
does not guarantee any deliveries, and that all messages should
stand by themselves, he (or she) only embarrass themselves by
failing to effectively quote.

And yet it's only *you* who regularly posts absurd articles because
of failing to consider the context. If everyone else can deal with
it, why can't you?

-- Richard
 
C

CBFalconer

Keith said:
.... snip ...

Chuck, there was more than enough information *in the article you
replied to* to make it perfectly obvious that jacob wasn't talking
about "strings" as defined by C99 7.1.1p1, and you replied as if
that were the only thing he could possibly have meant.

Here's the context that you quoted yourself:
.... snip ...
| >
| > I think that having an easy way to convert from the string
| > type to a null-terminated C-style string should be enough (and
| > the cast fulfills this purpose).

Just what did you think converting from "the string type" to "a
null-terminated C-style string" meant, in an article with the
subject "The lcc-win string library"?

Well, I guess I probably went off too fast. The idea of casting
strings set me off.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top