Making C better (by borrowing from C++)

C

CBFalconer

user923005 said:
.... snip ...
I don't really mind Jacob touting his compiler. It's not like
he's spamming the group. I do think that he is deliberately thick
and likes to start arguments. But I am guilty of that from time
to time as well.

Probably the best evaluation yet. BTW, he has admitted that his
'commercial' work doesn't support his 'free' system. Once upon a
time he had the source available. Maybe if he went back to that he
would get proper corrections and bug fixes.
 
J

jacob navia

CBFalconer said:
You seem incapable of telling MS FUD from fact. The C library is
NOT deprecated. Try reading the C standard.

You have reading problems Chuck?

I said that they provoke a warning in Microsoft compiler of course,
not that the C library is deprecated.
 
J

jacob navia

CBFalconer said:
How does it operate on machines with 1's complement and sign
magnitude numeric expression? What about machines with 9 bit
chars, or with 16 bit integers?

Complex numbers require the four operations and floating point.
If the machine can do that it can do complex numbers.
If it can't it can't and the C99 implementation will not
run either.
 
R

Richard Harter

Wrong. You can use gcc freely to develop anything at all. What
you can't do is incorporate GNU source code in your devopment
without licensing that development under GPL.

That's what he said: I quote (requote if you like):
"If you want to use gcc source code you have to put YOUR
application under the GPL."

I dunno about paying big bucks to Red Hat about getting around
GPL - sounds fishy to me - but your "correction" doesn't mention
that. You just reasserted what Jacob already said.
 
J

jacob navia

Richard said:
That's what he said: I quote (requote if you like):
"If you want to use gcc source code you have to put YOUR
application under the GPL."

I dunno about paying big bucks to Red Hat about getting around
GPL - sounds fishy to me - but your "correction" doesn't mention
that. You just reasserted what Jacob already said.

Cygnus corp made big bucks by selling versions
of gcc to people and allowing them with big
license fees to get away without disclosing their source.

They were a profitable company based exclusively on gcc
sales. They were bought by RedHat.

Note that I am not against RedHat making money. I just
did not want to work for them FOR FREE.

The problem with GNU from a developer viewpoint is that you toil and
work for years to do something, and somebody else sells it for
a profit without giving you a penny. This is a personal choice,
I do respect people that work for RedHat and develop device drivers
and compilers and stuff without being paid at all.

I just do not want to do that myself. I give my work away too,
but I am the owner of my work. Not somebody else.
 
R

Richard Heathfield

Harald van D?k said:
This is the output of gcc --version for one installation I use:

2.95.3

This is the output of gcc --version for another installation I use:

gcc (GCC) 3.4.6
Copyright (C) 2006 Free Software Foundation, Inc.

I believe you. Nevertheless, I get no such notice when I run gcc --version.
 
F

Flash Gordon

jacob navia wrote, On 26/12/07 22:43:
Cygnus corp made big bucks by selling versions
of gcc to people and allowing them with big
license fees to get away without disclosing their source.

They were a profitable company based exclusively on gcc
sales. They were bought by RedHat.

I don't know about when Cygnus ran it, but certainly when I started
using it what you are saying is completely wrong. The item with a
restrictive license was (and I believe still is) cygwin.dll which is the
*nix compatibility layer. If you application links against it and you
distribute it you either have to GPL you application or buy a license.
However, if you do not link against cygwin.dll (for example by telling
gcc to work like it does in the MinGW environment (by following the
instructions Cygwin provides) then you can sell your application as a
closed source applciation.

In other words you are mostly wrong.
Note that I am not against RedHat making money. I just
did not want to work for them FOR FREE.

When did you last see RedHat employees or shareholders posting here
advocating RedHat?
The problem with GNU from a developer viewpoint is that you toil and
work for years to do something, and somebody else sells it for
a profit without giving you a penny. This is a personal choice,
I do respect people that work for RedHat and develop device drivers
and compilers and stuff without being paid at all.

I just do not want to do that myself. I give my work away too,
but I am the owner of my work. Not somebody else.

Most of the regulars you complain about certainly have not said you
should not sell your work. I had sympathy for you earlier in this thread
(and posted to that effect) but you have lost it by repeatedly
misrepresenting what others are saying.
 
U

user923005

Cygnus corp made big bucks by selling versions
of gcc to people and allowing them with big
license fees to get away without disclosing their source.

Cygnus had full disclosure of their source. If you mean the customer,
then that is just the dual licence that lots of companies use (e.g.
MySQL).
They were a profitable company based exclusively on gcc
sales. They were bought by RedHat.

They offered a complete POSIX layer (that even did fork() on
Windows). GCC was less than 1% of the total software volume. I guess
that you have never actually used the Cygnus installer.
Note that I am not against RedHat making money. I just
did not want to work for them FOR FREE.

I agree that we should all have this choice.
The problem with GNU from a developer viewpoint is that you toil and
work for years to do something, and somebody else sells it for
a profit without giving you a penny. This is a personal choice,
I do respect people that work for RedHat and develop device drivers
and compilers and stuff without being paid at all.

That is one possibility. And yet Redhat has tons of developers and
they all get paid. So the "no pay" only happens sometimes -- and then
it is voluntary. I have done free work for GPL projects on many
occasions, though I greatly prefer the BSD style license for open
source. But that is just one person's opinion and worth about what
you paid for it.
I just do not want to do that myself. I give my work away too,
but I am the owner of my work. Not somebody else.

No argument there (unless the license of tools or libraries that you
are using says otherwise).
 
R

Richard Harter

Harald van D?k said:


I believe you. Nevertheless, I get no such notice when I run gcc --version.

Odd. I have 3.3.4 courtesy of djgpp and I get it. Did you by
any chance modify the source?
 
K

Keith Thompson

Odd. I have 3.3.4 courtesy of djgpp and I get it. Did you by
any chance modify the source?

The output of "gcc --version" was expanded in version 3.something.
I believe Richard uses a fairly old version.
 
P

Paul Hsieh

However, the key point is that I maintain a lot of code that was not
written according to these guidelines. I've got a fair amount of code
where a single function might contain hundreds and even thousands of
lines.

Yeah, and how much nested scope does that translate to? Remember its
O(*LOG*(#lines of code)).
[...] If I had the resources to do so, I might consider re-writing
those changes. However, in the absence of any known actual bugs in the
code, it's pretty hard to justify applying my scarce resources to
perform aesthetically motivated fix-ups.

Well more importantly what if there is *ONE* bug in there. Would you
rather have your scarce resources scan O(#lines) or O(*LOG*(#lines))
for where declarations are, to see if there is a simple "return
pointer to a local" kind of error?
[...] Since scopes nest in C,
there's no way to be certain unless declarations are restricted not
merely to the top of the scope, but to the top of the function.
This is the very definition of pedantry. The problem of finding the
top of a function is not significantly different from finding the set
of scope beginnings up to the top of the function declaration. The
depth of your scopes is typically O(log(lines in function)).

Nor it it very different from searching for previous definitions of
the identifier by name, which I've found to be a much quicker and more
reliable method.

Really? Personally, I cannot even make that work. VC++'s editor does
not have a backward search, nor does it have Perl compatible RE
search, nor does it have simple semantics for ping-pong buffering
between two different searches. But in C89, its hardly needed as an
eyeball scan is quick and usually sufficient.
[...] I would
argue against the "top of the function" solution, but since you don't
seem to be advocating it, I won't bother.
Since a large fraction of the code I've ever worked on was written by
other people, there's no guarantee that any given variable is declared
in any particular scope, no matter what I might prefer. I have to do
the same kind of backwards search to find the top of the right scope
that I would have to perform to find a declaration that's not at the top
of a scope, so I don't see how it saves me any trouble.
Search backwards through indents or "{"s is the same as scanning line
by
line to you?

Finding the indents or "{"s isn't sufficient; then you must still scan
line by line for the matching declaration; the context switch between
the two search modes costs at least as much as the nominally more
efficient mode saves; that's true whether using my eyes or using a
text editor.

WTF?!?! You do a "context switch" *BETWEEN EACH PAIR OF LINES* in C99
(and C++). You only do so between scope starts, declarations and
statements, in C89. You are not arguing honestly.
That's not a problem with my approach. My approach has never been
"smallest scope, regardless of whether or not it works". I've always
considered that it was implicitly clear that I was referring to the
smallest scope that is consistent with the actual use of the variable.

Yes, I was not accusing you of writing wrong code -- that's precisely
the problem! *Correctness* dictates where you put your declaration,
not some aspiration that your declarations will be close to all its
usages. And that means the above example becomes a very typical
situation.
 
M

Malcolm McLean

Chris Hills said:
I think there was a a unifying moment in the early 1990's and then the ISO
panels screwed it. Next year ( in a couple of days) we will be a decade
on from the last C standard and still virtually no one is really using it.
The standard wasn't accepted. Which was a disaster all round, because it
then makes it harder to try again.
 
M

Masood

Chris, I've usually found you to be a sensible person. You disappoint
me. Will you *please* stop using that deeply offensive term? I've
always been willing to discuss things with you; I'd truly hate for
that to end. (And yes, given the context, I presume that it's
directed at me and others.)

Now that I've made it clear that the term "Taliban" offends me, I'm
sure the trolls will use it at every opportunity. I expect better of
you.

Hi Keith,

I didn't mean to offend anyone with the word "Taleban" - I apologize if
you took offense.

I thought it was just a good description - I think it will be clear to
most people that the features a "C Taleban" shares with an "Afghanistan
Taleban" are fundamentalism and extremely-held beliefs, rather than any
violence and suchlike.

Best.
 
K

Keith Thompson

Masood said:
Hi Keith,

I didn't mean to offend anyone with the word "Taleban" - I apologize
if you took offense.

Thank you, apology accepted.

(I find it difficult to understand how referring to someone as
"Taleban" could be inoffensive, but I accept that you didn't intend to
offend.)
 
M

Malcolm McLean

Keith Thompson said:
(I find it difficult to understand how referring to someone as
"Taleban" could be inoffensive, but I accept that you didn't intend to
offend.)
If you write embedded timers for suicide bombs then presumably you're not
offended by being referred to as the "C language Taleban".
 
J

James Kuyper

jacob said:
....
You have reading problems Chuck?

I said that they provoke a warning in Microsoft compiler of course,
not that the C library is deprecated.

Then the above is a mis-quotation? It certainly matches the version of
your message that is available through both my ISP's news server and
through groups.google.com.
 
J

jacob navia

James said:
Then the above is a mis-quotation? It certainly matches the version of
your message that is available through both my ISP's news server and
through groups.google.com.

WE WERE SPEAKING ABOUT THE MICROSOFT C COMPILER WHEN USED FOR
COMPILING C PROGRAMS.

That sentence refers to that compiler and its usage for C.
 
J

James Kuyper

Masood wrote:
....
I didn't mean to offend anyone with the word "Taleban" - I apologize if
you took offense.

I can't imagine how you intended it to be taken as anything other than
offensive; being offensive strikes me as the whole point of such an
reference.

Please note that "I apologize if you took offense" isn't really a true
apology. It implies that the real blame is on Keith (and, by
implication, myself and others) for being offended, and that you still
don't understand that it was in fact offensive.

I would prefer to hear from you something along the line of "I apologize
for inadvertently writing something offensive.
I thought it was just a good description - I think it will be clear to
most people that the features a "C Taleban" shares with an "Afghanistan
Taleban" are fundamentalism and extremely-held beliefs, rather than any
violence and suchlike.

Then choose for your comparison some group other than the Taliban. The
Taliban's claim to fame is not their fundamentalism, which is
unfortunately common throughout the world. They're famous for the
violence and oppression with which they impose their understanding of
God's will on others.

The people you've designated at "the C Taleban" don't have any power
whatsoever to impose their understanding of the ISO committee's will on
anybody; I'm not saying that I know for certain that none of them would
abuse such power if they had it; but they don't have it, so it's a moot
point.
 
J

James Kuyper

Paul Hsieh wrote:
....
Really? Personally, I cannot even make that work. VC++'s editor does
not have a backward search, nor does it have Perl compatible RE
search, nor does it have simple semantics for ping-pong buffering
between two different searches. But in C89, its hardly needed as an
eyeball scan is quick and usually sufficient.

I've been programming computers for 30 years now, and I have never seen
a text editor that couldn't do a reverse search. Wow! It should be in a
museum somewhere; not on your computer.

....
WTF?!?! You do a "context switch" *BETWEEN EACH PAIR OF LINES* in C99
(and C++). You only do so between scope starts, declarations and
statements, in C89. You are not arguing honestly.

In my way of handling it, I am always looking for declarations of an
identifier by searching for the identifier name. I'm never searching for
'{' characters, so I never need to switch between the two search modes.

....
Yes, I was not accusing you of writing wrong code -- that's precisely
the problem! *Correctness* dictates where you put your declaration,
not some aspiration that your declarations will be close to all its
usages. And that means the above example becomes a very typical
situation.

"Correctness" is not sufficient to determine where a declaration of an
identifier should occur. Except for variables whose use requires them to
have external linkage, there's usually multiple different places you
could declare an identifier that would make the code equally correct.
I'm asserting that, of those many places, the one that gives the
variable the smallest possible scope minimizes search time for
declarations. It also reduces the opportunities for name conflicts.
 
R

Richard Heathfield

James Kuyper said:
Paul Hsieh wrote:
...

I've been programming computers for 30 years now, and I have never seen
a text editor that couldn't do a reverse search. Wow! It should be in a
museum somewhere; not on your computer.

He's talking nonsense. Of course VC's editor can search upwards. What's
more, it takes just a single keypress to jump to a declaration (and
another to pop back to where you came from), so he doesn't even /need/ the
reverse search that VC does in fact have.
 

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

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,157
Latest member
MercedesE4
Top