Doubts about pointers

S

santosh

Keith Thompson wrote:

Chuck specifically said that the "only real purpose" of TC2.01 is to
check portability to 16 bit systems. If you want to make sure that
your code doesn't implicitly assume that INT_MAX is 2**31-1, and
doesn't break if INT_MAX is 2**15-1, then TC2.01 would seem to be a
reasonable tool for that specialized job (I assume; I've never used it
myself). If that's not something you happen to need, that's fine, but
then I don't quite see the point of your response.

I was arguing the point that, as I see it, the possibility of checking
for certain portability violations does not seem to be a strong enough
reason to use Turbo C, when you have freely available, more standards
conformant implementations that compile code for systems that are more
widely used than DOS.

Yes, in can be used, but I only see it disappearing increasingly, both
courtesy of heavy marketing by MS and existence of other free
alternatives.
 
C

CBFalconer

santosh said:
.... snip ...

Most compiler systems take no effort to conform to the standard by
default. In fact you need to go out of your way to force them to.
Also for some compilers, their documentation often fails to mark
functions as standard or specific to their system.

There is no way, IMO, a newbie is going to learn standard C (or
portable C programming, which amounts to pretty much the same),
by tinkering around with heaps of implementations.

Except the two that I use, gcc and TC 2.01, are easily set for
proper ANSI operation. With TC we simply go to OPTIONS | COMPILER
| ERRORS | ANSI VIOLATIONS and turn everything on. For gcc, we use
-W -Wall -ansi -pedantic. I wrap that in an alias, named cc.
 
C

CBFalconer

.... snip ...

Your "I've ever bumped" here sounds like that's the only
non-conformance issue you are aware of, but it's not. Sadly, it
only confirms that you are advocating Turbo C just because you've
done it and you won't admit you were wrong ("sadly" part if a joke,
yes).

If you object to Richards statement, then you could be helpful and
list the known failures of the compiler. Don't forget to set it
for proper ANSI observance first.
 
A

Anand Hariharan

Anand Hariharan said:



Out of curiosity, would you be prepared to share your reasoning and/or
evidence?

<[email protected]>

and to be completely fair, <[email protected]>
(but I believe the damage had already been done and seems
irrevocable).

I have every respect for your contributions to comp.lang.c, but
then I have quite a bit of respect for Joona's contributions, too,

Thank you.

Joona has contributed more to c.l.c than I.

<snip>
 
R

Richard Heathfield

Chris McDonald said:
It's clearly a *long* time since you were in a tertiary education
institution, and most likely that you haven't taught in one for over 10
years!

I've never taught in a tertiary education institution. I have, however,
taught on-site, where deadlines tend to be rather tighter but, mercifully,
students are fewer!
- How do you feel about over 200 students expecting access to you,

Crowded already. Each to his own, right?
 
R

Richard Heathfield

Anand Hariharan said:
<[email protected]>

and to be completely fair, <[email protected]>
(but I believe the damage had already been done and seems
irrevocable).

Oh, I see. So one guy tears his hair out a little too loudly, *once*, four
years ago, and apologises for it later, but you now have him marked down
for life? That seems rather unforgiving, compared to the reactions of some
of your countrymen in that thread, who seemed to recognise that Joona was
just having a bad hair day.
 
R

Richard Heathfield

santosh said:
This is an unusual view, to say the least. To find out what is standard
C and what is implementation specific the only sure-fire way is to
consult the standard itself or some respected work like Harbison &
Steele.

Yes, absolutely. Or, of course, to be taught by a knowledgeable tutor.
Most compiler systems take no effort to conform to the standard by
default. In fact you need to go out of your way to force them to. Also
for some compilers, their documentation often fails to mark functions
as standard or specific to their system.

Right. All the more reason to use several such compilers.
There is no way, IMO, a newbie is going to learn standard C (or portable
C programming, which amounts to pretty much the same), by tinkering
around with heaps of implementations.

Right again. He or she learns C by being taught. He or she *practises* C by
writing C programs. He or she *experiences* C programs by running them. He
or she *experiences* non-portability by compiling programs under different
compilers.

Note that nowhere did I say "the ideal method for learning Standard C is to
lock the student in a room with ten different compilers and an information
famine". I am getting rather weary of statements such as "why not do
<foo>?" being interpreted as "why not do <foo> and only <foo> and nothing
but <foo>?"

I think you'll find that most
students will end up using extensions from all their implementations
with even more confusion and portability nightmares.
Why?

Also, a C course is typically of about four weeks duration, not
sufficient to learn by trial and error.

Whoever suggested trial and error? I certainly didn't.
They *will* have to be taught basic use of DOS command-line,

(a) I think that can be dispensed with if you're desperate enough, since TC
can be driven entirely from an IDE;
(b) they *ought* to be taught the basic use of a console.
if they
don't already know, which nowadays, most don't. Also you would have to
give at least a very brief explanation of the memory models of Turbo C,

No, you wouldn't *have* to.
to prevent them from tinkering with the settings,

"See these? Don't touch these. Hands off. Fingerpoken verboten, savvy?"
or declaring huge auto objects and such.

Why not just tell them the rules of C in this regard (we *are* teaching
them C, right)?
Yes, I agree that any conforming implementation should do in theory, but
nevertheless, for various extraneous reasons, Turbo C is not finding
much use these days, and I doubt it will.

Actually, it is frequently mentioned independently as the tool being used
by newbies here, a lot more than some other implementations.
 
Y

ymuntyan

(e-mail address removed) said:





No, ISTR that one or two other conformance issues exist, albeit hardly
serious ones.

Last time you first talked about issues being
not serious enough because you don't need access
to compiler source code for a fix (nice measure,
"just fix it and you're done"), then you finally
admitted there were even more serious issues.
Now again, "hardly serious ones". Have you got a
new scale?
I'm not *advocating* it. I'm just refusing to condemn it out of hand,
that's all. For most purposes, it's fine, and I don't see why people are
making out that it's a heap of junk, when it clearly isn't.

It's not a heap of junk, it's a compiler released
before the standard has been published.
If I wanted to
*advocate* an implementation, I'd plump for either Visual Studio 6 or gcc.
But what I actually advocate is not getting too hung up on compilers -
it's better to focus on the language, and not to give a stuff which
compiler is used. If one writes in clc-conforming C, the compiler rarely
if ever matters,

Except when it does matter, like when the compiler
is not conforming. Your favorite CLOCKS_PER_SEC
even appears in code posted in comp.lang.c!

It all was told in another thread not so long ago.
Yes, Turbo C is still quite good, except the rare
cases when it's not, and beginners surely know
which code is fine for Turbo C and which isn't.

Yevgen
 
R

Richard Heathfield

(e-mail address removed) said:

Last time you first talked about issues being
not serious enough because you don't need access
to compiler source code for a fix (nice measure,
"just fix it and you're done"), then you finally
admitted there were even more serious issues.

Well, I accepted that you (or whoever it was) weren't just making stuff up.
Was that a wrong assumption?
Now again, "hardly serious ones". Have you got a
new scale?

No, I don't even have a list. Do you?
It's not a heap of junk, it's a compiler released
before the standard has been published.

Yes, by about a week (or whatever). Big deal.
 
Y

ymuntyan

(e-mail address removed) said:



Well, I accepted that you (or whoever it was) weren't just making stuff up.
Was that a wrong assumption?

That wasn't wrong assumption, no.
No, I don't even have a list. Do you?

So indeed "serious enough" back then are again "hardly serious"
now. Here's a quote: "If one needs the source to make the
implementation conform, then that's a serious problem
that effectively renders the game not worth the candle,
and one would be better off seeking a better implementation."
Guess whose words these were.

You are a real Turbo C fan, just admit it :)
Yes, by about a week (or whatever). Big deal.

Yep. Borland is a perfect company, it makes perfect
software. Assumption that the compiler released together
with the standard is conforming is laughable alone,
even if you forget about actual present non-conformance
issues. No, I don't mean that Borland sucks or
Turbo C sucks, I am sure Turbo C was great. Back *then*,
not today though, when the minimum required level of
C89 conformance is "complete modulo bugs", and not for
today beginners whose conforming code won't work with
that compiler. I am pretty sure it works just fine for
Chuck F.
(Of course "a week" is very much made up, but it doesn't
really matter, things wouldn't be different if the compiler
was released a week after the standard, or even a year
after the standard)

Yevgen
 
R

Richard Heathfield

(e-mail address removed) said:

So indeed "serious enough" back then are again "hardly serious"
now. Here's a quote: "If one needs the source to make the
implementation conform, then that's a serious problem
that effectively renders the game not worth the candle,
and one would be better off seeking a better implementation."
Guess whose words these were.

Mine. So what? Do you have a list of conformance issues, or not?
You are a real Turbo C fan, just admit it :)

A bit, yes, and I don't mind admitting it. I don't *use* it terribly often,
but I did have cause to use it quite recently, and I found it very
comfortable indeed. I would have no hesitation whatsoever in using it to
teach C to someone who, for whatever reason, didn't have access to a
32-bit system, or perhaps someone who wanted to be able to do nice easy
graphics Real Fast and Real Simple.

Yep. Borland is a perfect company,

I disagree. For one thing, its Marketing Department should be fired, en
masse. Borland has always been hopeless at marketing.
it makes perfect software.

Again, I must disagree with you. But I *will* agree that it makes pretty
good software.

<snip>
 

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

Similar Threads

Doubts about pointers 17
Help with pointers 1
Sizes of pointers 233
Question about pointers 3
differentiating between pointers - "primary"? 9
Doubts about free() 9
pointers 25
Pointers 16

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top