[OT] Undefined behavior?

  • Thread starter Christopher Benson-Manica
  • Start date

C

Christopher Benson-Manica

My understanding is that the following program exhibited undefined
behavior until very recently:

#include <stdio.h>

int main( void )
{
printf( "Red Sox win! Red Sox win!\n" );
return 0;
}
 
Ad

Advertisements

T

Thomas Stegen

Christopher said:
My understanding is that the following program exhibited undefined
behavior until very recently:

So your understanding is that the program below used to have undefined
behaviour, but not anymore? It is never or always usually. :p
#include <stdio.h>

int main( void )
{
printf( "Red Sox win! Red Sox win!\n" );
return 0;
}

So, what is meant to be wrong with the above?
 
C

Carlos

Thomas said:
So your understanding is that the program below used to have undefined
behaviour, but not anymore? It is never or always usually. :p


So, what is meant to be wrong with the above?
I think that it's a reference to one of those minority sports.
 
K

Kenneth Brody

Thomas said:
So your understanding is that the program below used to have undefined
behaviour, but not anymore? It is never or always usually. :p


So, what is meant to be wrong with the above?

He forgot to include:

volatile long shot;

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <[email protected]>
 
Ad

Advertisements

?

=?iso-8859-1?q?Nils_O=2E_Sel=E5sdal?=

My understanding is that the following program exhibited undefined
behavior until very recently:

#include <stdio.h>

int main( void )
{
printf( "Red Sox win! Red Sox win!\n" );
return 0;
}
It's not exactly undefined behaviour. It's just that the
string in the printf statement is invalid.
 
M

Mike Wahler

Thomas Stegen said:
So your understanding is that the program below used to have undefined
behaviour, but not anymore? It is never or always usually. :p


So, what is meant to be wrong with the above?

Baseball fans will understand.

Christopher seems to be trying to display the euphoria he
shares with many, while also trying to stay topical. :)

-Mike
 
A

Artie Gold

Christopher said:
My understanding is that the following program exhibited undefined
behavior until very recently:

#include <stdio.h>

int main( void )
{
printf( "Red Sox win! Red Sox win!\n" );
return 0;
}
Not at all.

Now if you make that printf:

printf( "Red Sox World Champs!\n" );

nasal demons might ensue. Or might not. We'll see.

--ag

[Did `No No Nanette' make any money?]
 
E

Eric Sosman

Mike said:
Baseball fans will understand.

Christopher seems to be trying to display the euphoria he
shares with many, while also trying to stay topical. :)

For still greater topicality, here's a new version
of an old, familiar program:

#include <stdio.h>
int main(void) {
printf ("Hello, World Series!\n");
return "Yankees win" == "sure thing";
}
 
Ad

Advertisements

R

Richard Bos

Christopher Benson-Manica said:
My understanding is that the following program exhibited undefined
behavior until very recently:

#include <stdio.h>

int main( void )
{
printf( "Red Sox win! Red Sox win!\n" );
return 0;
}

Nope. It printed a line of text which is just as relevant to the real
world as "Hello, world!". It never ceases to amuse me how you USAliens
can get even more worked up about a game of rounders than my compatriots
get about chasing an inflated bladder.
(And anyway, surely they didn't get to the semi-final by losing all
their previous games?)

Richard
 
A

Alan Balmer

Nope. It printed a line of text which is just as relevant to the real
world as "Hello, world!". It never ceases to amuse me how you USAliens
can get even more worked up about a game of rounders than my compatriots
get about chasing an inflated bladder.

Come now, I think you have us outclassed with your soccer riots.
 
M

Michael Wojcik

It never ceases to amuse me how you USAliens
can get even more worked up about a game of rounders than my compatriots
get about chasing an inflated bladder.

*More* worked up? Perhaps US beats the Netherlands, but for some
parts of Europe I think the football hooligans still have the edge
over us. (And even if they didn't, football fans in other parts of
the world have shown considerably more craziness that fans of any
major US sport. Bulgatz documents South American and African wars
started over football games, in his _Ponzi Schemes, Invaders from
Mars, and More Extraordinary Popular Delusions and the Madness of
Crowds_, which despite the bulky title is a fine sequel of sorts to
Mackay's classic. I suspect US fans are in the main too fat and lazy
to get a good riot up.)
 
Ad

Advertisements

R

Richard Bos

*More* worked up? Perhaps US beats the Netherlands, but for some
parts of Europe I think the football hooligans still have the edge
over us.

Well, imprimis, it seems your baseball hooligans are quite capable of
causing unpleasant riots themselves, and secundis I wasn't really
talking about the idiots who call themselves fans but do nothing but
cause aggro, but about the _real_ fans. I've never seen any of those
post to usenet with a club .sig (though they probably do in sports
groups), but recently I've spotted several Sox fans who can't control
their excitement even in completely unrelated groups.
Now, I can understand _why_ they're excited. I mean, it's almost like
England winning a major football tournament...

Richard
 

Top