Casts

J

jacob navia

Richard said:
Malcolm McLean said:
The thought that [Mr Navia] would actually have anything to say about
C is funny. The idea that someone would read it, and take it
seriously, is just plain scary.
I've never written a C compiler. I've written a BASIC interpreter
which semi-compiles on the fly, and I can tell you that was difficult
enough. Have you? Jacob Navia has.

No, he has not. He has taken an existing compiler, and tweaked bits of
it occasionally.

This is a lie. I have rewritten everything in lcc-win32. I wrote
the assembler, the linker, the debugger, the IDE, the optimizer,
the lexer and syntax analysis, there is nothing from lcc but the name.

I have said this here many times but you go on telling stories.

I repeat: there is almost nothing left from lcc in lcc-win32.
 
J

jacob navia

Malcolm said:
I've never written a C compiler. I've written a BASIC interpreter which
semi-compiles on the fly, and I can tell you that was difficult enough.
Have you? Jacob Navia has.

Forget this guy. He always pisses to my messages telling me
I do not know how to program under windows, or saying something
idiotic like this message.

C'est la vie

jacob
 
B

Barry

Malcolm McLean said:
I've never written a C compiler. I've written a BASIC interpreter which
semi-compiles on the fly, and I can tell you that was difficult enough.
Have you? Jacob Navia has.

What C compiler did Mr. Navia write? You certainly are not proposing
he wrote lcc. Of course BASIC interpreters are in as much demand
as MC5 C compilers these days :).
 
J

jacob navia

Barry said:
What C compiler did Mr. Navia write? You certainly are not proposing
he wrote lcc. Of course BASIC interpreters are in as much demand
as MC5 C compilers these days :).

The only thging you are able to do is piss other people.

I wrote lcc-win32, from the syntax analysis, optimizer
assembler, linker, debugger, IDE, resource editor, whatever.

There is almost nothing left from the lcc 3.6 I used
as a template. All the syntax analysis is rewritten to accommodate
C99 and many other enhancements.

But to have a normal discussion with people that can only insult is
a lost battle. It is so much easier to piss other
people than to contribute to the community.

What have YOU written that you give away for free?
What is your contribution?

True, my tutorial is not the best C book in the world but
it is surely better than yours.

The negative attitude of you, heathfield, and others towards my work
doesn't hide the fact that it is very popular and used
world wide.

Propose something for a change. Insulting is easy. Working is
less easy.

jacob
 
R

Richard Tobin

I can't think of a single good reason for casting a void * to a
char *.
[/QUOTE]
Then how can you build a malloc system? :)

Richard does not object to *converting*, only *casting*. You can do
all your converting with assignments, and if you throw in passing
and returning to and from functions the number of cases where casting
seems natural is greatly reduced. But not to zero in my view!

-- Richard
 
M

Malcolm McLean

jacob navia said:
What have YOU written that you give away for free?
What is your contribution?
MiniBASIC seems to be my major contribution to the commons.
However no-one ever gets back to me, apart from about three people who have
used the BASIC interpreter. So I don't know whether I am providing anything
useful or not.
 
J

jacob navia

Malcolm said:
MiniBASIC seems to be my major contribution to the commons.
However no-one ever gets back to me, apart from about three people who
have used the BASIC interpreter. So I don't know whether I am providing
anything useful or not.

An interpreter is quite a lot of work.
Even if nobody would use it, you have tried to
offer other people a present, and that is important.
 
B

Barry

jacob navia said:
The only thging you are able to do is piss other people.

I wrote lcc-win32, from the syntax analysis, optimizer
assembler, linker, debugger, IDE, resource editor, whatever.

There is almost nothing left from the lcc 3.6 I used
as a template. All the syntax analysis is rewritten to accommodate
C99 and many other enhancements.

But to have a normal discussion with people that can only insult is
a lost battle. It is so much easier to piss other
people than to contribute to the community.

What have YOU written that you give away for free?

I haven't actually looked. Where is the free source code for
lcc-win32?
What is your contribution?

Your message was propagated on the internet.
True, my tutorial is not the best C book in the world but
it is surely better than yours.

The companies I worked for compensated me well.
I have no need to write a book that repeats what is already
available.
 
R

Richard Heathfield

jacob navia said:
Richard said:
Malcolm McLean said:
The thought that [Mr Navia] would actually have anything to say
about
C is funny. The idea that someone would read it, and take it
seriously, is just plain scary.

I've never written a C compiler. I've written a BASIC interpreter
which semi-compiles on the fly, and I can tell you that was
difficult enough. Have you? Jacob Navia has.

No, he has not. He has taken an existing compiler, and tweaked bits
of it occasionally.

This is a lie.

No, it isn't. A lie is a deliberate untruth. What I said, I believed to
be true. I may have been mistaken, but I did not lie.
I have rewritten everything in lcc-win32.

Heaven help your users, then.
 
M

Malcolm McLean

Barry said:
I haven't actually looked. Where is the free source code for
lcc-win32?
Open source isn't the same thing as freeware.
There can be many reasons for not releasing source. For instance some of my
programs incorporate routines that other people have an interest in. You can
only give your own intellectual property away for nothing.
 
C

CBFalconer

Richard said:
CBFalconer said:

Why would you need to cast a void * to a char * to build a malloc
system? What's wrong with the guaranteed implicit conversion?

Fair enough.
 
C

CBFalconer

jacob said:
.... snip ...

The negative attitude of you, heathfield, and others towards my
work doesn't hide the fact that it is very popular and used
world wide.

Propose something for a change. Insulting is easy. Working is
less easy.

All right. I propose you restrict discussion of lcc-win32 to the
comp.compilers.lcc newsgroup, where it is topical. Come here for C
questions. Go to comp.programming for algorithmic problems. Deal?
 
J

jacob navia

CBFalconer said:
jacob navia wrote:
... snip ...

All right. I propose you restrict discussion of lcc-win32 to the
comp.compilers.lcc newsgroup, where it is topical. Come here for C
questions. Go to comp.programming for algorithmic problems. Deal?

Did you read the subject of the thread?

Are casts a feature exclusively found in lcc-win32? Or rather are
casts part of the C language and as such ON TOPIC here???

You feel forced apparently to mark all my posts as off topic.

OK. If you like that, granted, at least you do not insult. But
it would be better if you read my posts before dismissing them as
off topic Chuck.

Casts are part of the standard language.
 
M

Mark McIntyre

If the declaration of the temp is 76 lines before
you have to look it up, then come back to see why you use
a temporary variable,

Well, ok - but in C99 there's no reason to do this - declare when
required.
int c = *((char *)p);

is immediately clear what you are doing.

You are joking, surely?
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
F

Flash Gordon

Harald van Dijk wrote, On 24/06/07 00:21:
And you need a cast to portably print a non-void pointer value using %p...

Thanks for saving me the trouble of arguing with Jacob, your rebuttal
was exactly in line with my thoughts when I posted :)
 
J

jacob navia

You are joking, surely?

Seems pretty clear to me.

-- Richard[/QUOTE]

To me too.

The problem with the temporary is that even if the declaration
is done C99 style and it is immediately visible, we are left wondering
what the PURPOSE of that temporary is...

You have to look in the whole function to see that it is nowhere else
used and its purpose is just to avoid a cast.

int c = *((char *)p);

You read that c is assigned the value of p treated as a char *.
Period. Immediately visible.
 
R

Richard Tobin

....
The problem with the temporary is that even if the declaration
is done C99 style and it is immediately visible, we are left wondering
what the PURPOSE of that temporary is...[/QUOTE]

Another, admittedly minor, problem is that assignment introduces an
alias - two variables pointing to the same memory. Other things being
equal, that is undesirable.

-- Richard
 
K

Keith Thompson

jacob navia said:
Richard said:
Malcolm McLean said:
The thought that [Mr Navia] would actually have anything to say about
C is funny. The idea that someone would read it, and take it
seriously, is just plain scary.

I've never written a C compiler. I've written a BASIC interpreter
which semi-compiles on the fly, and I can tell you that was difficult
enough. Have you? Jacob Navia has.
No, he has not. He has taken an existing compiler, and tweaked bits
of it occasionally.

This is a lie. I have rewritten everything in lcc-win32. I wrote
the assembler, the linker, the debugger, the IDE, the optimizer,
the lexer and syntax analysis, there is nothing from lcc but the name.

I have said this here many times but you go on telling stories.

I repeat: there is almost nothing left from lcc in lcc-win32.

To the best of my recollection, you have never made this statement
before in this newsgroup. It's entirely possible that you've said so
previously in a message that I didn't see, or in one that I've
forgotten.

Before I read your latest followup, I believed, based on what I've
seen of what you yourself have written here, that Richard's statement
about the relationship between lcc and lcc-win32 was essentially
correct. I have no doubt that Richard had reached the same
conclusion. That's not a criticism; there's absolutely nothing wrong
with basing something on previous work. It's simply the impression
I've gotten from what I've read here. Since I don't use either lcc or
lcc-win32, it makes very little difference to me one way or the other.

The word "lie" implies deliberate deception. You should be much more
careful about accusing people of lying. Richard made a perfectly
reasonable assumption; by calling him a liar, you only make yourself
look like a fool.
 
M

Mark McIntyre

You are joking, surely?

Seems pretty clear to me.[/QUOTE]

<mode=sarcastic>
Oh, I thought he was writing a /tutorial/ - you know, for beginners...
</mode>

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 

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

Pointer casts for OOP 2
function casts 27
Casts on lvalues 74
Union and pointer casts? 13
Better casts? 10
casts and pointers 0
cast musings 19
Casts for srand? (FAQ 13.17) 2

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top