breaking from a loop only works when I compile with optimisation

K

Keith Thompson

lloyd said:
Keith Thompson was all like:

Heavens no, I always use the computer keyboard to type them in :p

Hmm. I see you're posting through Google Groups; it should
generate them for you automatically.
 
I

Ike Naar

Quick side-question... Are "&&" and "||" sequence points?

Yes, 6.5.13.4:
Unlike the bitwise binary & operator, the && operator guarantees
left-to-right evaluation; there is a sequence point after the
evaluation of the first operand. If the first operand compares
equal to 0, the second operand is not evaluated.

Likewise, 6.5.14.4 for the || operator.
 
B

Ben Bacarisse

Kenneth Brody said:
Assuming you're serious...

K&R1 was published in 1978, so it's at least that old.

Except that setjmp and longjmp are not in K&R1. They predate the ANSI
standard, and I suspect they were around in the late 70's, but before
standardisation there was a rather loose idea of what was in the C
run-time library.
 
L

lloyd

Ben said:
Except that setjmp and longjmp are not in K&R1.  They predate the ANSI
standard, and I suspect they were around in the late 70's, but before
standardisation there was a rather loose idea of what was in the C
run-time library.

Yes, K&R1 is still my only guide to C. I'm sure there are lots of
other useful things out there I should make myself aware of.
 
L

lawrence.jones

Ben Bacarisse said:
Except that setjmp and longjmp are not in K&R1. They predate the ANSI
standard, and I suspect they were around in the late 70's, but before
standardisation there was a rather loose idea of what was in the C
run-time library.

They're in my 7th Edition Unix manual, which was contemporaneous with
K&R, so they're that old, too.
 
S

Shao Miller

Yes, as are "," and "?:".
And the function call operator "()", whose sequence point is "through
the paper", rather than between left and right, if I'm not mistaken.
Such a curious operator...
 
B

Ben Bacarisse

lloyd said:
Yes, K&R1 is still my only guide to C. I'm sure there are lots of
other useful things out there I should make myself aware of.

Yes. malloc, for example. fread. strtod and friends. The list is
long.

BTW, K and/or R note that K&R1 does not try to document the whole
standard C library, so using it as your only guide was not advisable
even in 1978.
 
N

Nick Keighley

Ben Bacarisse wrote:


Yes, K&R1 is still my only guide to C.

probably not a very idea it teaches a slightly dated pre-standard form
of C (at that time K&R *was* the defacto standard).

I'd upgrade to K&R2 as soon as possible.
 
K

Keith Thompson

Nick Keighley said:
probably not a very idea it teaches a slightly dated pre-standard form
of C (at that time K&R *was* the defacto standard).

I'd drop the word "slightly". k&R1 C doesn't even have prototypes.
K&R2 covers ANSI/ISO C89/C90, which is officially obsolete but
widely used. There's been another ISO standard since then, C99,
and work is in progress on yet another.
I'd upgrade to K&R2 as soon as possible.

Agreed.

[...]
 
E

Eric Sosman

On 8/31/2010 10:03 AM, Kenneth Brody wrote:
On 8/29/2010 10:31 PM, Eric Sosman wrote:
[...] everything
seems plausible except on days when you lunch on baloney sandwiches.
[...]
You ate bologna on Thursdays,[...]
Baloney. Meant what I said, said what I meant. Baloney.

My bologna has a first name,
It's O, S, C, A, R.
My bologna has a second name,
It's M, A, Y, E, R.
...

plonk

Your loss, I'd say. Equally, though, your choice. And your
funeral.
 
B

Ben Bacarisse

Kenneth Brody said:
On 8/31/2010 7:30 PM, Ben Bacarisse wrote:
[...]
BTW, K and/or R note that K&R1 does not try to document the whole
standard C library, so using it as your only guide was not advisable
even in 1978.

It was, however, a great guide for someone coming from other
languages, to learn the syntax of the language.

Indubitably. K&R is iconic in my mind. When I come across language X I
search for "the K&R of X" -- often with no success. Every language
should have a clear, short, authoritative exposition in some text or
other.
 
O

Oliver Jackson

On 8/31/2010 8:11 PM, Eric Sosman wrote:
On 8/31/2010 10:03 AM, Kenneth Brody wrote:
On 8/29/2010 10:31 PM, Eric Sosman wrote:
[...] everything
seems plausible except on days when you lunch on baloney sandwiches..
[...]
You ate bologna on Thursdays,[...]
Baloney. Meant what I said, said what I meant. Baloney.
My bologna has a first name,
It's O, S, C, A, R.
My bologna has a second name,
It's M, A, Y, E, R.
...

     Your loss, I'd say.  Equally, though, your choice.  And your
funeral.

Guy's a retard.
 
O

Oliver Jackson

Well, I guess if you think that, you won't mind...

*plonk*

I take it you didn't see Kenneth Brody's freakish post. It was some
sort of macabre poem about bologna. It had nothing to do with C, and
frankly it gave me an upset stomach. Nonsense like that has no place
in comp.lang.c.
 
K

Keith Thompson

Oliver Jackson said:
I take it you didn't see Kenneth Brody's freakish post. It was some
sort of macabre poem about bologna. It had nothing to do with C, and
frankly it gave me an upset stomach. Nonsense like that has no place
in comp.lang.c.

It's an advertising jingle for Oscar Meyer bologna. Quoting the
lyrics was certainly off-topic, but I for one found it mildly amusing
(which isn't to suggest that you should). I have no idea why you
found it "macabre". Kenneth Brody has contributed enough to this
newsgroup (more than you have) that an occasional off-topic joke
is tolerable.

You're certainly under no obligation to read his articles, but if you
choose not to it's your loss, IMHO.

Oh, and calling him a "retard" is offensive.
 

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,776
Messages
2,569,602
Members
45,185
Latest member
GluceaReviews

Latest Threads

Top