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

  • Thread starter robert maas, see http://tinyurl.com/uh3t
  • Start date
R

Richard Heathfield

Robert Maas, see http://tinyurl.com/uh3t said:
No, I'm saying that in English and most other natural languages,
and in lisp, c (this newsgroup), c++, algol, and most other
programming languages, putting double quotes around some text means
to take it *literally* (verbatim, no substitutions allowed or
intended).

Well, you're mistaken. In some cases, it's merely to distinguish between
use and mention.
I honestly thought you meant that as a way to get
general information about the C/machine function-call mechanism, or
some utility called "func", etc.,

Then not only are you confusing me with Stephen Sprunk but also you are
demonstrating your stupidity again. Please just don't talk again
without first thinking through what you're saying. Just about every
article you post is so packed full of silly that there's no room left
for sane.
Those are extremely stupid (ignorant) and inappropriate
recommedations.

Not quite, but close. Rather, they are recommendations for the extremely
stupid and inappropriate.

Incidentally, "stupid" and "ignorant" are not synonyms. The latter
condition is curable. You, it appears, suffer from the former.
 
S

Spiros Bousbouras

If you have the money to pay for my time, I might be willing to do it.


Before anybody ever told me the name of it? How would you expect me
to have found out myself before I knew what the name was of the
thing I was supposed to find out? I don't know of any search engine
where I could have typed in .bz2 and gotten back bzip2/bunzip2 as a
response. Do you know of any such??

"file filename" (without the quotes) would have likely told you how
the
file was compressed. If it doesn't you should try and get a better
version
of file ; the GNU website is likely to have one.
 
J

J. J. Farrell

Before anybody ever told me the name of it? How would you expect me
to have found out myself before I knew what the name was of the
thing I was supposed to find out? I don't know of any search engine
where I could have typed in .bz2 and gotten back bzip2/bunzip2 as a
response. Do you know of any such??

It's perhaps a bit new for you to have heard of, but there's a very
good search engine called Google which can be found at http://google.com/
.. Searching for .bz2 takes you straight to the answer. It's a great
way to help avoid looking like a complete idiot.
 
S

Spiros Bousbouras

"file filename" (without the quotes) would have likely told you how
the
file was compressed. If it doesn't you should try and get a better
version
of file ; the GNU website is likely to have one.

A little test showed that typing bz2 on Wikipedia also reveals the
utilities relevant to the format. Another test showed that Google,
which was suggested above, will reveal right at the top of the page
the home page for bzip2.
 
R

Robert Maas, see http://tinyurl.com/uh3t

I had no idea that bunzip2 would be the appropriate
From: Richard Heathfield <[email protected]>
Learn how to learn. It'll do you a power of good.

Practice what you preach: Suppose I post a URL for a file which I
claim is plain text, and I claim what's in the file is the
information you've been seeking, but when you click on the link all
that comes up in the Web browser is binary illegible garbage,
because it's actually data-compressed using some program you've
never encountered before. The name of the file is GoodInfo.txt.ic,
so how are you supposed to learn the name of the program that
compressed it except by asking back in the newsgroup where I posted
the URL (or trying to ask me by private e-mail, risking that the
e-mail address I posted is forged or otherwise doesn't work, such
as because of the several hundred thousand spam your e-mail is
mixed with so I'd never see it, but if you're seeing my article by
Google Groups then my address is munged by GG so you can't even
learn what my address was supposed to be in the first place)?
 
R

Richard Heathfield

Robert Maas, see http://tinyurl.com/uh3t said:
Practice what you preach:

I do.
Suppose I post a URL for a file which I
claim is plain text, and I claim what's in the file is the
information you've been seeking, but when you click on the link all
that comes up in the Web browser is binary illegible garbage,
because it's actually data-compressed using some program you've
never encountered before. The name of the file is GoodInfo.txt.ic,
so how are you supposed to learn the name of the program that
compressed it except by asking back in the newsgroup where I posted
the URL (or trying to ask me by private e-mail, risking that the
e-mail address I posted is forged or otherwise doesn't work, such
as because of the several hundred thousand spam your e-mail is
mixed with so I'd never see it, but if you're seeing my article by
Google Groups then my address is munged by GG so you can't even
learn what my address was supposed to be in the first place)?

Well, it wasn't .ic, but .bz2 - and entering bz2 into Google gives you
the home page of the bzip2 guys on the first hit. How easy does it have
to be before you can finally understand?
 
S

santosh

Robert said:
From: Richard Heathfield <[email protected]>
Learn how to learn. It'll do you a power of good.

Practice what you preach: Suppose I post a URL for a file which I
claim is plain text, and I claim what's in the file is the
information you've been seeking, but when you click on the link all
that comes up in the Web browser is binary illegible garbage,
because it's actually data-compressed using some program you've
never encountered before. The name of the file is GoodInfo.txt.ic,
so how are you supposed to learn the name of the program that
compressed it except by asking back in the newsgroup where I posted
the URL [ ... ]

I usually try Google before asking in a forum.
(or trying to ask me by private e-mail, risking that the
e-mail address I posted is forged or otherwise doesn't work, such
as because of the several hundred thousand spam your e-mail is
mixed with so I'd never see it, but if you're seeing my article by
Google Groups then my address is munged by GG so you can't even
learn what my address was supposed to be in the first place)?

Google will show you the demunged address if you enter a small text
sequence to prove you're not a bot.
 
D

David Thompson

On Sun, 18 Mar 2007 09:18:52 +0000, Flash Gordon
Stop talking complete and utter rubbish. It has been pointed out to your
more than once already that the headers do NOT control what happens when
you link. I have NEVER come across a compiler where including a header
causes the relevant library to be linked in.
I have -- MSVC(++) has a #pragma which puts a "need this library"
thingie in the object file, which the linker then uses. Their standard
headers (aka SDK) use it, at least last time I looked, (only) to
record which variant (singlethread/multithread/etc.) of the C library
is needed, so that if you try to link object files that were compiled
in different (and sometimes incompatible) modes you get a useful
(though unmandated and as is too often the case not overly clear)
diagnostic. You could also use it for your own libraries if you want,
but of course not portably, and I've not seen anyone actually do so
since it's easy enough to attach needed libraries in several other
more familiar and portable ways.

This certainly isn't required nor very common, but it is permitted.
 
F

Flash Gordon

David Thompson wrote, On 15/04/07 09:13:
On Sun, 18 Mar 2007 09:18:52 +0000, Flash Gordon

I have -- MSVC(++) has a #pragma which puts a "need this library"
thingie in the object file, which the linker then uses. Their standard
headers (aka SDK) use it, at least last time I looked, (only) to
record which variant (singlethread/multithread/etc.) of the C library
is needed, so that if you try to link object files that were compiled
in different (and sometimes incompatible) modes you get a useful
(though unmandated and as is too often the case not overly clear)
diagnostic. You could also use it for your own libraries if you want,
but of course not portably, and I've not seen anyone actually do so
since it's easy enough to attach needed libraries in several other
more familiar and portable ways.

That's still only causing a warning, not actually causing the library to
be linked in! ;-)
This certainly isn't required nor very common, but it is permitted.

I agree that it is permitted, but I'm sure you will agree that it is
wrong to say that headers control what library is linked since it is at
least very rare. For example, I know I had to select
singlethread/multithread etc in the linker section of MSVC++ when I last
used it. :)

BTW, why the sudden flood of responses, including to messages a month
old? Had a nice long vacation?
 
R

Richard Heathfield

Flash Gordon said:

BTW, why the sudden flood of responses, including to messages a month
old? Had a nice long vacation?

David Thompson's responses usually come in small batches. They are
generally worth reading, and I have learned to dread them. :) They
normally supply corrections to mistakes that nobody else has got around
to correcting or indeed even noticed, but which David T (usually
rightly) feels worthy of comment.

You might call him a picker-up of unconsidered trifles.
 
C

CBFalconer

Richard said:
Flash Gordon said:



David Thompson's responses usually come in small batches. They are
generally worth reading, and I have learned to dread them. :)
They normally supply corrections to mistakes that nobody else has
got around to correcting or indeed even noticed, but which David T
(usually rightly) feels worthy of comment.

You might call him a picker-up of unconsidered trifles.

You don't do badly at that game yourself.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
 
M

Mark T

Flash Gordon said:
David Thompson wrote, On 15/04/07 09:13:

That's still only causing a warning, not actually causing the library to
be linked in! ;-)


I agree that it is permitted, but I'm sure you will agree that it is wrong
to say that headers control what library is linked since it is at least
very rare. For example, I know I had to select singlethread/multithread
etc in the linker section of MSVC++ when I last used it. :)

BTW, why the sudden flood of responses, including to messages a month old?
Had a nice long vacation?

Actually, you select singlethread/multithread in the *compiler* section of
MSVC++, which places a library-search record in the object file for the
correct library. Header files can do this themselves with #pragma
comment(lib,"libname"). Including header files with these statements will
create object files that instruct the linker to link in the library.

Not so rare :^)

-Mark T
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top