another stupid c bug. (endless for loop)

S

Skybuck Flying

I was just trying to figure out how some C code worked... I needed to make a
loop to test all possible values for a 16 bit word.

Surprise Surprise... C sucks at it... once again :D lol... C is such a bad
language it amazes me everytime :D

Just look at this shit:

unsigned short int i;

// I set i to a large value so one can see the wrap occuring.
for (i=65500; i<65536; i++)
{
// endless loop
}

for (i=65500; i<=65535; i++)
{
// endless loop
}

for (i=65500; i<65536; ++i)
{
// endless loop
}

for (i=65500; i<=65535; ++i)
{
// endless loop
}

There... I tried out all possibilities...

The original loop was something like:
for (i=0; i<=65535; i++)
{
// endless loop
}

Ha ! C SUCKS BALLS

Man... just a simple pascal loop and I would have been done already.

var
i : word;
for i:=0 to 65535 do
begin

end;

Lol... I don't even have to test that code....

I know 100% sure it will work just fine ;)

With C one never knows lol hahahahaha.

NOW GO **** YOURSELF hahahahahaha
 
S

Steve Leach

bad language it amazes me everytime[sic] :D

Just look at this [ profanity removed ]:

unsigned short int i;

// I set i to a large value so one can see the wrap occuring[sic].
for (i=65500; i<65536; i++)
{
// endless loop
}
<snip> more horrible code follows.

-----------------------------------------------
From: The Oracle
To: Troll,

Your compiler privileges are hereby revoked.
Come to think of it, so are your text
editor privileges.

You Owe the Oracle an essay on binary
number theory.
------------------------------------------------

This reminds me of the man who took a chain-saw back to return it,
saying that it was the worst machine in the world and took him hours to
cut through a two foot log. The salesman started it up to see what was
wrong and the man yelled "Hey, What's that sound?!"


............................................................
 
A

Alan Balmer

On Fri, 27 Aug 2004 18:43:23 +0200, "Skybuck Flying"

I have news for you - it isn't the language that's showing its
stupidity here.
There... I tried out all possibilities...

I would have tried only one - the one that works.

Go troll some other place. If you need a C program, hire a programmer.
 
S

Skybuck Flying

Alan Balmer said:
On Fri, 27 Aug 2004 18:43:23 +0200, "Skybuck Flying"

I have news for you - it isn't the language that's showing its
stupidity here.

I would have tried only one - the one that works.

Go troll some other place. If you need a C program, hire a programmer.

Lol

From: Superman
To: The man without a dick

Oh wise one... will you enlighten me with all your wisedom LOL
 
E

Eric Sosman

Skybuck said:
I was just trying to figure out how some C code worked... I needed to make a
loop to test all possible values for a 16 bit word.

Surprise Surprise... C sucks at it... once again :D lol... C is such a bad
language it amazes me everytime :D

Just look at this shit:
> [progressively worse diatribe snipped]

S.F., I was in the process of writing up some advice you
might have found helpful. But your abusive language offends
me, and I choose not to help offensive people. You will get
no further help from me until and unless your mother teaches
you better behavior. If she fails in this endeavor, I suggest
you follow the final instruction from your own posting.
 
S

Skybuck Flying

Eric Sosman said:
Skybuck said:
I was just trying to figure out how some C code worked... I needed to make a
loop to test all possible values for a 16 bit word.

Surprise Surprise... C sucks at it... once again :D lol... C is such a bad
language it amazes me everytime :D

Just look at this shit:
[progressively worse diatribe snipped]

S.F., I was in the process of writing up some advice you
might have found helpful. But your abusive language offends
me, and I choose not to help offensive people. You will get
no further help from me until and unless your mother teaches
you better behavior. If she fails in this endeavor, I suggest
you follow the final instruction from your own posting.

Hahahahahahahahaha too funny.

Like I need help with this... go screw yourself lol hahahah tooo funny.
 
C

CBFalconer

Skybuck said:
I was just trying to figure out how some C code worked... I needed
to make a loop to test all possible values for a 16 bit word.
.... snip nonsense ...

NOW GO **** YOURSELF hahahahahaha

PLONK
 
T

Till Crueger

, .
,~~~~~~~~. /| |\
(Oooooch...) {_;""\}
( *MHMPFF* )O o (* @'-,
\|||/ `~~~~~~~~" ,~ \~,""
(o o) ; , ("
,----ooO--(_)-------. | | |
| Please | /| | \
| don't feed the | ,(=~~==[])
| TROLL's ! | ( \`-' ;(
'--------------Ooo--' ) \ /\ \
|__|__| ( ) ) ) )
|| || * /_/ /_/
ooO Ooo |_\ |_\ JW

(Taken from www.ascii-art.de)
 
D

Default User

Alan said:
On Fri, 27 Aug 2004 18:43:23 +0200, "Skybuck Flying"

I have news for you - it isn't the language that's showing its
stupidity here.

I would have tried only one - the one that works.

Go troll some other place. If you need a C program, hire a programmer.


You mean you guys haven't killfiled Skybuck already? I got him months
ago.



Brian Rodenborn
 
K

Kelsey Bjarnason

[snips]

Hahahahahahahahaha too funny.

Like I need help with this... go screw yourself lol hahahah tooo funny.

Obviously you do; you were trying to write C code and failing miserably to
get it right. None of us - the regulars - would have had the particular
problem you mentioned, because we actually know C.

It follows, then, that the problem isn't C (since we can get the code
working) but with the developer - you. The solution is to replace the
defective portion of the development stream, which, in your case, means
hiring a C programmer if you want code written in C.

HTH. HAND.
 
S

Skybuck Flying

Well **** me !

Seems like Delphi has trouble with for loops as well but this time for 32
bit longwords.

var
a : longword;

for a :=0 to 4294967295 do
begin
// ...
end;

[Hint] Project1.dpr(170): FOR or WHILE loop executes zero times - deleted

BUT

At least I won't try it in C... since that would suck even worse ;) I ll bet
! :p hehehehehe.
 
S

Skybuck Flying

CBFalconer said:
PLONK

--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

Lol funnnnyy ! hahahahahaha

Goood one !
 
I

its me

Can someone please kill this twat ?


Skybuck Flying said:
Eric Sosman said:
Skybuck said:
I was just trying to figure out how some C code worked... I needed to make a
loop to test all possible values for a 16 bit word.

Surprise Surprise... C sucks at it... once again :D lol... C is such a bad
language it amazes me everytime :D

Just look at this shit:
[progressively worse diatribe snipped]

S.F., I was in the process of writing up some advice you
might have found helpful. But your abusive language offends
me, and I choose not to help offensive people. You will get
no further help from me until and unless your mother teaches
you better behavior. If she fails in this endeavor, I suggest
you follow the final instruction from your own posting.

Hahahahahahahahaha too funny.

Like I need help with this... go screw yourself lol hahahah tooo funny.
 
T

Thomas Matthews

Skybuck said:
I was just trying to figure out how some C code worked... I needed to make a
loop to test all possible values for a 16 bit word.

Surprise Surprise... C sucks at it... once again :D lol... C is such a bad
language it amazes me everytime :D

Just look at this shit:

unsigned short int i;

// I set i to a large value so one can see the wrap occuring.
for (i=65500; i<65536; i++)
{
// endless loop
}

for (i=65500; i<=65535; i++)
{
// endless loop
}

for (i=65500; i<65536; ++i)
{
// endless loop
}

for (i=65500; i<=65535; ++i)
{
// endless loop
}

There... I tried out all possibilities...

The original loop was something like:
for (i=0; i<=65535; i++)
{
// endless loop
}

Ha ! C SUCKS BALLS

Man... just a simple pascal loop and I would have been done already.

var
i : word;
for i:=0 to 65535 do
begin

end;

Lol... I don't even have to test that code....

I know 100% sure it will work just fine ;)

With C one never knows lol hahahahaha.

NOW GO **** YOURSELF hahahahahaha

<Sorry about feeding the troll, but monsters have some
rights>

You can simplify your program to an algorithm that will
work in any language, Pascal, Delphi, C, Fortran, LISP,
Cobol, etc.

Let N be the number of bits in a processor's native
integral unit.

Let M be the maximum number, usually 2^(N-1), which
can be held in the processor's integral unit.

Let I be an index variable of the processor's integral type.

For I := (M - 5) to (M + 5) in steps of 1
do Anything or Nothing.

Now the above algorithm will most likely cause undefined
behavior in any language you code it in. The behavior
won't be the expected behavior of reaching the target
value.

Hahahahahahah, Computers have limitations. Wow!

Followups set to

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
 
K

Kelsey Bjarnason

Well **** me !

Seems like Delphi has trouble with for loops as well but this time for 32
bit longwords.

var
a : longword;

for a :=0 to 4294967295 do
begin
// ...
end;

[Hint] Project1.dpr(170): FOR or WHILE loop executes zero times - deleted

Given the code and the message, I suspect longwords are signed 32-bit
values, so the result is actually a loop from 0 to some negative number -
which means the loop will never execute.

The problem, again, appears to have nothing to do with the language, but
with the developer.
 
K

Keith Thompson

Skybuck Flying said:
I was just trying to figure out how some C code worked... I needed to make a
loop to test all possible values for a 16 bit word.

You merely have to understand how C for loops work. i is an unsigned
short; on your system, unsigned short apparently has a maximum value
of 65535. You use the condition "i <= 65535"; a little thought would
reveal that this is always going to be true.

A C for loop is not defined to iterate over a specified range. Any C
textbook will tell you how it is defined. Take a moment to look it up.

Incidentally, your use of vulgar language is going to get you into a
lot of killfiles. Some people are understandably offended. I'm not
offended, just annoyed and bored.

Apparently you hate C. That's your right. I encourage you to stop
using it, and to stop participating in the comp.lang.c newsgroup. C
is not a perfect language, and most of us know its flaws far better
than you do. Your help is not needed here.
 
S

Skybuck Flying

Kelsey Bjarnason said:
[snips]

Hahahahahahahahaha too funny.

Like I need help with this... go screw yourself lol hahahah tooo funny.

Obviously you do; you were trying to write C code and failing miserably to
get it right. None of us - the regulars - would have had the particular
problem you mentioned, because we actually know C.

It follows, then, that the problem isn't C (since we can get the code
working) but with the developer - you. The solution is to replace the
defective portion of the development stream, which, in your case, means
hiring a C programmer if you want code written in C.

Man... if you gonna donna a C bug... please take the time to make up a
good/funny denial.

This one is just lame.

You lamo hahahahaha.
 

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,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top